Trouble using python PIL library to crop and save image

The box is (left, upper, right, lower) so maybe you meant (2407, 804, 2407+71, 804+796)?

Edit: All four coordinates are measured from the top/left corner, and describe the distance from that corner to the left edge, top edge, right edge and bottom edge.

Your code should look like this, to get a 300×200 area from position 2407,804:

left = 2407
top = 804
width = 300
height = 200
box = (left, top, left+width, top+height)
area = img.crop(box)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)