Skip to content
Related Articles

Related Articles

Improve Article
Python PIL | copy() method
  • Last Updated : 25 Jun, 2019
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




# 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()

Output:




# 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()

Output:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :