Python PIL | copy() method

PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. PIL.Image.copy() method copies the image to another image object, this method is useful when we need to copy the image but also retain the original.

Syntax:Image.copy()

Parameters: no arguments

Returns:An image object
filter_none

edit
close

play_arrow

link
brightness_4
code

# Importing Image module from PIL package
from PIL import Image
  
# creating a image object
im1 = Image.open(r"C:\Users\sadow984\Desktop\i3.PNG")
  
# copying image to another image object
im2 = im1.copy()
  
# shows the copied image
im2.show()

chevron_right


Output:

filter_none

edit
close

play_arrow

link
brightness_4
code

# Importing Image module from PIL package
from PIL import Image
  
# creating a image object
im1 = Image.open(r"C:\Users\sadow984\Desktop\i3.PNG")
  
# copying image to another image object
im2 = im1.copy()
  
# shows the original image
im1.show()

chevron_right


Output:



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.