This site is no longer active and is available for archival purposes only. Registration and login is disabled.

PNG image problem


PNG image problem

Postby fzammetti » Sep 22, 2003 @ 4:30am

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!
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby fzammetti » Sep 22, 2003 @ 4:47am

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...
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby fzammetti » Sep 22, 2003 @ 5:06am

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.
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby Johan » Sep 22, 2003 @ 7:38am

Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby fzammetti » Sep 22, 2003 @ 12:27pm

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby Johan » Sep 22, 2003 @ 1:00pm

Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby fzammetti » Sep 22, 2003 @ 2:41pm

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby StarFury » Oct 5, 2003 @ 8:49pm

Frank: I don't know if this is any good for you, PSP has an optimiser available at save time:

Image

select options...

Image

select run optimizer...

Image

Do your thing :)
<B><I> Earth Needs You! Don't Let Us Down - </I> <A target="_blank" HREF="http://www.pocketblasters.com">Galactic Assault - Invaders Turbo Edition - Teddies Revenge</A> [All for FREE!!]</B>
User avatar
StarFury
pm Member
 
Posts: 105
Joined: May 7, 2003 @ 3:11pm
Location: Norfolk, England


Postby fzammetti » Oct 5, 2003 @ 9:26pm

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).
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby Justt » Oct 6, 2003 @ 4:16am

Justt
-
User avatar
Justt
pm Member
 
Posts: 23
Joined: Mar 23, 2003 @ 10:00pm


Postby Pejo Software - Per » Oct 6, 2003 @ 7:01am

User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum