Saturday, April 24, 2010

The PNG Gamma Dilemma

While working on a design I came across a strange issue with my background image (.PNG format) in IE. The colors of my image were darker… which off course ruined my whole design.




Formulation of the problem:

The problem arises from the fact that browsers have traditionally treated the RGB values specified in CSS (and HTML), GIF and JPEG as identical (numerically and colorimetrically). With PNG, however, the stored gamma information is used to "correct" the RGB values prior to displaying the image, which means that they won't match other design elements when viewed in certain browsers.

I was able to remove the gamma information with a freeware PNG optimizer, called PNGCrush.

For more information about this issue – read: