In this article, we will learn to crop an image using pillow library. Cropping an image means to select a rectangular region inside an image and removing everything outside the rectangle. To crop an image we make use of
crop() method on image objects.
Syntax : IMG.crop(box_tuple)
Image_path- Location of the image
IMG- Image to crop
box_tuple- [left, up, right, bottom] of the image to crop
Returns : An Image object which represents the cropped image.
Input Image :
Input Image :
- Python | Copy and Paste Images onto other Image using Pillow
- Python | Working with the Image Data Type in pillow
- Python PIL | Image.crop() method
- Getting started with Scikit-image: image processing in Python
- Converting an image to ASCII image in Python
- Python PIL | Image.tell()
- Python PIL | Image.new() method
- Image Captioning using Python
- Python PIL | Image.getdata()
- Python PIL | Image.histogram()
- Python | Image blurring using OpenCV
- Python PIL | Image.convert() Method
- Python PIL | Image.frombytes() Method
- Image Resizing using OpenCV | Python
- Python PIL | Image.draft() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.