- Hands-On Image Processing with Python
- Sandipan Dey
- 58字
- 2025-02-22 06:42:27
Cropping an image
We can use the crop() function with the desired rectangle argument to crop the corresponding area from the image, as shown in the following code:
im_c = im.crop((175,75,320,200)) # crop the rectangle given by (left, top, right, bottom) from the image
im_c.show()
The next figure shows the cropped image created using the previous code:
