There is a crop() method:

w, h = yourImage.size
yourImage.crop((0, 30, w, h-30)).save(...)

Image Module - Pillow (PIL Fork) 9.2.0 documentation

https://pillow.readthedocs.io/en/stable/reference/Image.html

The Image module provides a class with the same name which is used to represent a ... from PIL import Image with Image.open("hopper.jpg") as im: # The crop ...

python - How to crop an image using PIL? - Stack Overflow

https://stackoverflow.com/questions/9983263/how-to-crop-an-image-using-pil

There is a crop() method: w, h = yourImage.size yourImage.crop((0, 30, w, h-30)).save(...) ... Yes, I know that im.crop(box) is used for cropping the image.

python PIL库的crop函数--图片裁剪操作_banxia1995的博客-CSDN ...

https://blog.csdn.net/banxia1995/article/details/85330212

2018年12月28日 ... 使用PIL裁切图片使用PIL需要引用Image,使用Image的open(file)方法可以返回打开的图片,使用crop((x0,y0,x1,y1))方法可以对图片做裁切。

How to Crop an Image Using PIL? – Finxter

https://blog.finxter.com/how-to-crop-an-image-using-pil/

To crop an image to a certain area, use the PIL function Image.crop(left, upper, right, lower) that defines the area to be cropped using two points in the ...

Transforming and augmenting images — Torchvision main ...

https://pytorch.org/vision/stable/transforms.html

Transforms on PIL Image and torch.*Tensor. CenterCrop (size). Crops the given image at the center.