[Image-SIG] open, show, png, blank

Nelson Tong tongsnelson.ise at gmail.com
Tue Jan 31 19:38:25 CET 2012

thanks for reply, Matthias,

when I use "show()", the image appears to have an all-white
background, nothing else is on it.  The size does indeed match the png
size , I used the following to confirm:

    x, y =  outIm.size
    print "size of outImg: " + str(x)+" " + str(y);

I tries to resave the png as a  png image with a different name using
PIL and show() of the 2nd png image still appear to have all-white
background with nothing on it.

but If I open the images (both the 1st and the re-saved image ) with
the command line command of "display", I can see the images via

Attached is example image which I am having problem with.  Can you
reproduce the same problem I'm seeing with this image, possibly due to
the png image being broken?


On 1/29/12, Matthias Bock <matthiasbock at users.sourceforge.net> wrote:
> Am Freitag, den 27.01.2012, 11:11 -0500 schrieb Nelson Tong:
>>  outI = Image.open( fileOutPNGFile )
>>  outI.show();
>> The code run without error, but the image return via X-windows  on my
>> linux machine is a blank image, without visible graphic on it.
> What color is this "blank": Grey? White?
> Does the size match the PNG size?
>> I am 100% positive that the image of fileOutPNGFile is not corrupted
>> because I am able to open it via the web-browser.
> Web browsers can open corrupted image files.
>> I tried the same code another to open  another png file which I use
>> PIL to draw and save as png.   The code above is able to open and show
>> this png file properly.
> Sounds to me, as if the first PNG was broken.
> Try this:
>  outI = Image.open( fileOutPNGFile )
>  outI.show()
>  outI.save('test.png')
>  out2 = Image.open('test.png')
>  out2.show()
>> why might this happen?
> If the code doesn't help solving the issue,
> could you send the PNG to the list?
> Cheers, Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcp.png
Type: image/png
Size: 1060277 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20120131/ad43217b/attachment-0001.png>

More information about the Image-SIG mailing list