I have probably a very simple problem with the PIL crop function: the cropped colors of the image are completely screwed. Here is the code:
>>> from PIL import Image >>> img = Image.open('football.jpg') >>> img <PIL.JpegImagePlugin.JpegImageFile instance at 0x00 >>> img.format 'JPEG' >>> img.mode 'RGB' >>> box = (120,190,400,415) >>> area = img.crop(box) >>> area <PIL.Image._ImageCrop instance at 0x00D56328> >>> area.format >>> area.mode 'RGB' >>> output = open('cropped_football.jpg', 'w') >>> area.save(output) >>> output.close()
Original Image: 
and exit .
As you can see, the output colors are completely confused ...
Thanks in advance for your help!
-Hoff
source share