Answers for "crop image with pillow python"

5

pil crop image

im = Image.open('image.jpg') 
im = im.crop((left, top, right, bottom))  # coordinates of the crop
Posted by: Guest on October-17-2020
-2

crop image python

import cv2
img = cv2.imread("lenna.png")
crop_img = img[y:y+h, x:x+w]
cv2.imshow("cropped", crop_img)
cv2.waitKey(0)
Posted by: Guest on June-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language