VOOZH about

URL: https://www.geeksforgeeks.org/python/python-crop-image-using-pillow/

⇱ Python | Crop image using pillow - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | Crop image using pillow

Last Updated : 16 Oct, 2019
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) Parameters : 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.
Example 1: Input Image : 👁 Image
Output : 👁 Image
Example 2:
Input Image : 👁 Image
Output : 👁 Image
Comment
Article Tags:
Article Tags: