views:

1865

answers:

5

Hi guys,

I'm working on a website that uses lots of png24 files, for transparency.

I need to replace them with png8 files, as all the png fix style javascript workarounds for png24 cause IE6 to lock up randomly.

See this link to get an idea of the symptoms IE6 displays - http://blogs.cozi.com/tech/2008/03/transparent-pngs-can-deadlock-ie6.html

Does anybody know an easy way of targeting existing png24 files, to replace them with the png8s?

I'm using a OS X, and file browsers like Adobe bridge don't show this, nor can I find the info on the commandline, or the finder.

Help!

A: 

Perhaps imagemagick helps you out at converting png24 files to png8 files.

Cheery
+3  A: 

The file utility on OSX can tell you the colour depth in a PNG file, e.g:

% file foo.png 
foo.png: PNG image data, 1514 x 1514, 8-bit grayscale, non-interlaced
Alnitak
+3  A: 

I think you might be asking the wrong question. PNG8s don't have the true-alpha you've been working hard to fix in IE6. If you replace the PNG24s with PNG8s you are no better off than replacing them with GIFs.

Maybe you could test an alternative replacement/fix script - there are some shockingly bad ones out there, maybe that's where the problem is?

Here's (and I say this tongue in cheek!) the right question.

JoeBloggs
PNG-8 actually supports storing an alpha value with every color on the palate, so, with he right program and optimization, they can look great. See one of the other answers.
Daniel Beardsley
+1  A: 

JoeBloggs is right, you're asking the wrong question.

I've never had IE6 break with a good pngfix script. You've either got a bad pngfix script, or a bad IE6 install.

PNG8 will ruin your nice transparencies and make it look like you're using GIFs.

ceejayoz
+3  A: 

You actually CAN get alpha transparency in PNG-8's but it's super complicated. http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/ http://www.personal.psu.edu/drs18/blogs/davidstong/2007/09/png8_alpha_transparency_from_f.html

It basically creates GIF like substance for IE6 and a real PNG with alpha transparency for better browsers. It's a more pleasant degradation path. Right now, I think you need Fireworks, but I am exploring other options.