There is a crop() method:

w, h = yourImage.size
yourImage.crop((0, 30, w, h-30)).save(...)
Answer from ninjagecko on Stack Overflow
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › reference › Image.html
Image module - Pillow (PIL Fork) 12.2.0 documentation
This crops the input image with the provided coordinates: from PIL import Image with Image.open("hopper.jpg") as im: # The crop method from the Image module takes four coordinates as input.
🌐
Pillow
pillow.readthedocs.io
Pillow (PIL Fork) 12.2.0 documentation
Pillow for enterprise is available via the Tidelift Subscription. Learn more. The Python Imaging Library adds image processing capabilities to your Python interpreter.
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › handbook › image-file-formats.html
Image file formats - Pillow (PIL Fork) 12.2.0 documentation
The GIF loader creates an image memory the same size as the GIF file’s logical screen size, and pastes the actual pixel data (the local image) into this image. If you only want the actual pixel rectangle, you can crop the image:
🌐
Kanoki
kanoki.org › 2022 › 02 › 14 › how-to-crop-central-region-of-image-using-python-pil
How to crop the central region of image using python PIL | kanoki
February 14, 2022 - Now we know the coordinates of our cropped image, so we will pass these parameters in the PIL Image.crop() function to get the cropped image from the center
🌐
Reddit
reddit.com › r/learnprogramming › [python] why is this pil crop not working unless i .show() it?
r/learnprogramming on Reddit: [Python] Why is this PIL crop not working unless I .show() it?
October 28, 2016 -

This doesn't really make a lot of sense to me but my cropping doesn't work unless I .show() the crop.

crop = image.crop((968, 508, 1050, 532))   
crop.show()  # <- this is the issue
temp = Image.new(mode='RGBA', size = crop.size, color=(255,255,255,0))
image.paste(temp, (968, 508, 1050, 532))  #Sets cropped area to white

image.paste(crop, (1017, 508, 1099, 532)) #Replaces cropped area, shifted

So this crops a section of my picture, turns it all white, then places the cropped part back, just shifted a bit to the right. However, if I remove the crop.show() line then it doesn't work. Here are the images, the change is to the left of "Passing"

One

Two

Any help to this confusing issue is appreciated.

🌐
Python Programming
pythonprogramming.altervista.org › resize-images-with-pil-2
Resize and crop images with PIL – python programming
January 18, 2020 - from PIL import Image import glob import os lst_imgs = [i for i in glob.glob("*.png")] # It creates a folder called ltl if does't exist folder = "crp" if folder not in os.listdir(): os.mkdir(folder) print(lst_imgs) area = (0, 0, 68, 60) for i in lst_imgs: img = Image.open(i) img = img.crop(area) # img = img.resize((64, 64), Image.ANTIALIAS) img.save(folder + "\\" + i[:-4] + "_" + folder + ".png") print("Done") os.startfile(folder)
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-pil-image-crop-method
Image.crop() method - Python PIL - GeeksforGeeks
January 21, 2026 - Image.crop() method in PIL (Python Imaging Library) is used to extract a specific rectangular region from an image. It takes a box defined by four coordinates left, upper, right and lower and returns only that selected area as a new image.
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › reference › ImageFilter.html
ImageFilter module - Pillow (PIL Fork) 12.2.0 documentation
The ImageFilter module contains definitions for a pre-defined set of filters, which can be be used with the Image.filter() method. from PIL import ImageFilter im1 = im.filter(ImageFilter.BLUR) im2 = im.filter(ImageFilter.MinFilter(3)) im3 = im.filter(ImageFilter.MinFilter) # same as MinFilter(3)
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-pil-image-resize-method
Python PIL | Image.resize() method - GeeksforGeeks
December 10, 2025 - Explanation: resize((200, 200), Image.LANCZOS) applies high-quality downscaling for a sharper result. Example 2: Here, we change only the width and automatically compute the height to maintain aspect ratio. ... from PIL import Image img = Image.open("bear.png") w, h = img.size new_w = 400 new_h = int(h * (new_w / w)) out = img.resize((new_w, new_h), Image.BICUBIC) out.show()
🌐
Sleepyweim
sleepyweim.com › home › 2019 › may › 22 › python: crop image
Python: Crop Image – Sleepy Weim
May 22, 2019 - from PIL import Image # # Crop first image # img = Image.open("3day1.png") area = (405, 120, 1450, 675) cropimg = img.crop(area) cropimg.save("3day1_small.png") # # Crop second image # img = Image.open("3day2.png") area = (405, 670, 1450, 905) cropimg = img.crop(area) cropimg.save("3day2_small.png") # # Combine both into single image # img1 = Image.open("3day1_small.png") img2 = Image.open("3day2_small.png") newimg = Image.new("RGB", (1045, 790)) newimg.paste(img1, (0,0)) newimg.paste(img2, (0,555)) newimg.save("3day.png") NB: You may not have PIL installed on your system.
🌐
CodeSpeedy
codespeedy.com › home › crop an image using python
How to Crop an Image in Python using PIL - CodeSpeedy
December 23, 2019 - In this tutorial, you will learn how to crop an Existing Image in Python. We simply use Python Imaging Library (PIL) Module to crop an Image.
🌐
Davescripts
davescripts.com › code › python-image › python-pillow-crop-image
Python Pillow: Crop Image - DaveScripts.com
import os, glob import sys from PIL import Image files = glob.glob('*.png') for f in files: img = Image.open(f) left = 0 upper = 0 right = 800 lower = 600 box = (left, upper, right, lower) cropped = img.crop(box) cropped.save("crop_" + f) × ·
🌐
Auth0
auth0.com › home › blog › image processing in python with pillow
Image Processing in Python with Pillow
December 2, 2020 - Use Image’s crop() method to create a new image by cropping a section from an existing one. This method takes a 4-tuple that defines the position and size of the cropped region, as shown in the method call example below: ... Pillow’s coordinate system starts with (0, 0) in the upper left corner, with x increasing from left to right and y increasing from top to bottom:
🌐
Medium
tomaszs2.medium.com › effortless-image-cropping-with-python-automate-your-workflow-in-minute-987fbec9c3e8
Effortless Image Cropping with Python: Automate Your Workflow in Minute
November 11, 2024 - They’re packed with programming shortcuts and tips, designed to keep the essentials right at your fingertips — just like this script does with image cropping! ... import cv2 from PIL import Image import numpy as np from pathlib import Path # Define source and destination folders input_folder = "demo" # Source folder for images output_folder = "demo/output" # Destination folder for processed images def crop_important_region(image_path, output_path): # Load image image = cv2.imread(str(image_path)) if image is None: raise ValueError(f"Unable to load image: {image_path}") # Set up file name p
🌐
Codecademy
codecademy.com › docs › python:pillow › image module › .crop()
Python:Pillow | Image Module | .crop() | Codecademy
June 7, 2024 - In the Pillow library, the .crop() method returns a given image cropped to a specified rectangular area.
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › reference › ImageFile.html
ImageFile module - Pillow (PIL Fork) 12.2.0 documentation
Whether or not to load truncated image files. User code may change this. ... By default, Pillow processes image data in blocks. This helps to prevent excessive use of resources.
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › reference › ImageDraw.html
ImageDraw module - Pillow (PIL Fork) 12.2.0 documentation
The graphics interface uses the same coordinate system as PIL itself, with (0, 0) in the upper left corner. Any pixels drawn outside of the image bounds will be discarded.
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › handbook › tutorial.html
Tutorial - Pillow (PIL Fork) 12.2.0 documentation
from PIL import ImageSequence for frame in ImageSequence.Iterator(im): # ...do something to frame...
🌐
Mouse Vs Python
blog.pythonlibrary.org › home › how to crop a photo with python
How to Crop a Photo with Python - Mouse Vs Python
August 24, 2021 - Let’s write some code to try to crop the picture down to just the grasshopper’s head: from PIL import Image def crop(image_path, coords, saved_location): """ @param image_path: The path to the image to edit @param coords: A tuple of x/y coordinates (x1, y1, x2, y2) @param saved_location: Path to save the cropped image """ image_obj = Image.open(image_path) cropped_image = image_obj.crop(coords) cropped_image.save(saved_location) cropped_image.show() if __name__ == '__main__': image = 'grasshopper.jpg' crop(image, (161, 166, 706, 1050), 'cropped.jpg')