Page 1 of 1
PNG image problem

Posted:
Sep 22, 2003 @ 4:30am
by fzammetti
I am completely at a loss to explain this... I have a PNG image that is not rendering properly in a GD app. I've tried it in the sample apps (just replaced the ipaq image for instance), and it still renders incorrectly... The image is squished to about half of the area it should take up, and the background color is changed to green, the other half is empty black.
Could someone take a peek at this image file:
... and see if you can figure out why it's not displaying properly (at the least verify that it's not just me, that you see it not rendering properly too).
I've re-saved it a number of times using the same settings I use for all my other PNGs, but this is the only one I'm having a problem with. Thanks all!

Posted:
Sep 22, 2003 @ 4:47am
by fzammetti
Update: If I save the image in 24-bit color, it renders fine. I'm doing the same optimization I do on all my other images, that is, I make them 256-color paletized (optimized octree). I do this for space considerations, since I don't really need more than 256 colors.
This of course makes the image 14k instead of the 8k it really should be, so I'd really like to know why this is still...

Posted:
Sep 22, 2003 @ 5:06am
by fzammetti
Update #2...
I resolved the issue by doing a flood fill with RGB 0,0,1 in the "background" black areas. That solved the problem, and has no real perceptible effect on the image's appearance.
My suspicion is that the optimizer thinks this image is greyscale, which I suppose is a fair thing to think, and does something funky with it in that special case. Does PNG have a special greyscale mode maybe that GD doesn't fully or properly support? I don't know.
I'm leaving this post open to comment because it's possible this represents a bug in the GD code. I'll leave that image that I linked to out there for Johan, or anyone else, to take a look it.
I'd still like to know why that image didn't work as it was.

Posted:
Sep 22, 2003 @ 7:38am
by Johan

Posted:
Sep 22, 2003 @ 12:27pm
by fzammetti

Posted:
Sep 22, 2003 @ 1:00pm
by Johan

Posted:
Sep 22, 2003 @ 2:41pm
by fzammetti

Posted:
Oct 5, 2003 @ 8:49pm
by StarFury
Frank: I don't know if this is any good for you, PSP has an optimiser available at save time:
select options...
select run optimizer...
Do your thing


Posted:
Oct 5, 2003 @ 9:26pm
by fzammetti
Yep, that's what I used. Seems that if the image uses colors with nothing but gray tones, it treats it as a grayscale image no matter what, regardless of what you select in the optimizer settings. May be just a bug in the optimizer, that's my guess, I'm not sure though. I didn't go so far as to look at the PNG specs to see if the image is truly saved as a grayscale PNG, but it makes sense in light of what Johan said. No big deal, my work-around worked just fine. Gives me a reason to upgrade to PSP 8.0 anyway (I did at work, time to do so at home too I guess).

Posted:
Oct 6, 2003 @ 4:16am
by Justt

Posted:
Oct 6, 2003 @ 7:01am
by Pejo Software - Per