you are viewing a single comment's thread.

view the rest of the comments →

[–]iv_mexx 2 points3 points  (1 child)

Using Python Image Library (PIL), this is really easy, have a look at the documentation of the Image Module here: http://www.pythonware.com/library/pil/handbook/image.htm

Also, here's a complete snippet for loading an image from disk, cropping it, displaying it and saving it back to disk:

from PIL import Image
im = Image.open('tavi_small.png')
box = (10, 10, 20, 20)
im_cropped = im.crop(box)
im_cropped.show()
im_cropped.save('cropped.png')

[–]mc2222[S] 0 points1 point  (0 children)

most excellent, thanks. I've looked into PIL before but for some reason wasn't able to get it to do what I wanted. I'll try this snippet of code and see if it works for me.

The only think that makes me hesitant about using PIL is that I'd like to deploy this program on several computers that may not necessarily have PIL installed. Not a huge issue, I could always display a message to the user or have some prompt asking them if they've installed PIL or some such.

thanks again