« The Web innovations that Internet users really crave

The journey to becoming a software engineer — the process begins »

Remove the gamma (gAMA) chunk from a PNG image to fix darker colors in IE

December 29th, 2006 by Brian | 7 Comments »

With the release of IE 7, the consistent use of PNG for Web sites and Web applications moved closer to a reality. However, while recently experimenting with a few concepts that rely heavily on PNG, I discovered IE interprets the gamma (gAMA) data chunk contained within a PNG differently than other browsers. The image will render darker, which can be problematic if you need a GIF or JPG to match the color profile of a PNG.

The W3C specification pinpoints the gamma and chromaticity data associated with a PNG as the primary advantage of this format, since it is a mechanism for more accurately managing colors across different platforms. Yet, it is the PNG alpha transparency that gives Web developers an opportunity to extend the design pallet. Unfortunately, in order to take advantage of one, it is necessary to compromise the other, and therefore, the gamma data should be removed.

TweakPNG is an amazing program for accomplishing this task. It is available under the GNU GPL, and is free to use. You can download it by clicking here. According to the Web site, the program has not been updated for a few years, but it works on Windows 95, 98, ME, 2000, and XP. Open up your PNG with TweakPNG, highlight the gAMA row under the Chunk column, right-click, and left-click on Delete. Now save the PNG, and the issue is resolved.

For more information on the PNG file format, visit the W3C specification page here:

http://www.w3.org/TR/PNG/

Tags: , ,

Posted in: Web Development

This entry was posted on Friday, December 29th, 2006 at 7:26 pm and is filed under Web Development.

You can follow any responses to this entry through the RSS 2.0 feed.

Both comments and pings are currently closed.

7 Responses to “Remove the gamma (gAMA) chunk from a PNG image to fix darker colors in IE”

  1. Bilge says:

    Thanks a lot for that.

  2. Fred says:

    Nice one!
    I still wish Microsoft would do something about it, I’ve started using png’s for websites a lot and the alpha capabilities are simply amazing. The fact that IE7 is pretty much (?) the only browser not capable of rendering them properly just baffles me…

  3. [...] Although PNGs will be shown correctly for the most part by IE7, it interprets the gAMA of the PNG as darker than what it should be. [...]

  4. [...] Remove the gamma (gAMA) chunk from a PNG image to fix darker colors in IE » d’bug (tags: png gamma) [...]

  5. [...] fidèlement la raison technique de ce problème je vous invite à découvrir une autre manière de résoudre le gAMA bug pour contenter IE6 et IE7, les derniers navigateurs à encore afficher le bug, en attendant la [...]

  6. [...] halus milik format png24 (seperti kasus saya), maka kita bisa memperbaiki file png nya.. menurut tutorial ini atau ini, kita bisa menggunakan tool TweakPNG (gratis, lisensi GPL). caranya sederhana, yaitu cukup [...]