getbbox method from python image library (PIL) not working
问题 I want to crop an image to its smaller size, by cutting the white areas on the borders. I tried the solution suggested in this forum Crop a PNG image to its minimum size but the getbbox() method of pil is returning a bounding box of the same size of the image, i.e., it seems that it doesn't recognize the blank areas around. I tried the following: >>>import Image >>>im=Image.open("myfile.png") >>>print im.format, im.size, im.mode >>>print im.getbbox() PNG (2400,1800) RGBA (0,0,2400,1800) I