PIL question about crop method

John Salerno johnjsal at NOSPAMgmail.com
Wed Apr 5 14:48:21 EDT 2006


I might be way off target even looking into this method for what I need 
to do, but I'm still a little confused about the description of it:

crop
im.crop(box) => image

Returns a rectangular region from the current image. The box is a 
4-tuple defining the left, upper, right, and lower pixel coordinate.

I'm probably just being a little dense again, but how exactly do you 
write the tuple? Wouldn't a coordinates parameter be a tuple of tuples? 
It sounds like here you only need four numbers, but I don't understand 
what 'left, upper, right, and lower pixel coordinate' means. It doesn't 
seem like it's asking for a set of coordinates for each corner of the 
box, or for a set at all. How do four separate numbers make up coordinates?

Thanks.



More information about the Python-list mailing list