--- title: Internet Explorer and PNG's date: '2004-06-03T00:00:00+00:00' categories: - blog - clockrocket layout: post --- It's the bain of every Web Developers life. The one thing that would make all our lives just that little bit nicer. Proper support for PNG's in all common web browsers. I'd kind of gotten over the fact that Internet Explorer doesn't, and probably never will, support alpha transparent PNG files. I guess it's because Microsoft don't see the need for them on their site. What has been bugging me is the fact that PNG images always seemed to display slightly too dark in IE. Very irritating if you have an image that needs to match a colour specified in your CSS file. So I decided last night to try and find out why this happens, and it turns out the Internet Explorer doesn't handle the gAMA chunk correctly, and the solution to this is to use pngcrush to remove the gAMA chunk and the cHRM chunk and put in a sRGB chunk. It's all a bit technical but, rest assured, the command below will correct your PNG files so they display at the correct brightness in Internet Explorer.
# pngcrush -srgb 1 -rem gama -rem chrm [infile].png [outfile].png
At some point in the near future i'll write a bash script or something to automate fixing directories of files as it's a bit of a pain to do one file at a time.