Python PIL | Image.crop() method Last Updated : 17 Jun, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. PIL.Image.crop() method is used to crop a rectangular portion of any image. Syntax: PIL.Image.crop(box = None)Parameters: box - a 4-tuple defining the left, upper, right, and lower pixel coordinate.Return type: Image (Returns a rectangular region as (left, upper, right, lower)-tuple).Return: An Image object. Code #1: Python3 # Importing Image class from PIL module from PIL import Image # Opens a image in RGB mode im = Image.open(r"C:\Users\Admin\Pictures\geeks.png") # Size of the image in pixels (size of original image) # (This is not mandatory) width, height = im.size # Setting the points for cropped image left = 5 top = height / 4 right = 164 bottom = 3 * height / 4 # Cropped image of above dimension # (It will not change original image) im1 = im.crop((left, top, right, bottom)) # Shows the image in image viewer im1.show() Original Image Output: Code #2: Python3 # Importing Image class from PIL module from PIL import Image # Opens a image in RGB mode im = Image.open(r"C:\Users\Admin\Pictures\network.png") # Setting the points for cropped image left = 155 top = 65 right = 360 bottom = 270 # Cropped image of above dimension # (It will not change original image) im1 = im.crop((left, top, right, bottom)) # Shows the image in image viewer im1.show() Original Image: Output: Comment More infoAdvertise with us Next Article Python PIL | Image.frombytes() Method S sanjeev2552 Follow Improve Article Tags : Python Image-Processing Practice Tags : python Similar Reads Python PIL | Image.draft() method PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, 2 min read Python PIL | Image.convert() Method PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, 2 min read Python PIL | Image.frombytes() Method PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, 2 min read 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 R 1 min read Python PIL | Image.frombuffer() method PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, 2 min read Python PIL | composite() method PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. PIL.Image.composite() method creates composite image by blending images using a transparency mask. Here, mask is another image which remains transparent when composite together. Syntax: PIL.Image 2 min read Like