Tips and Tricks About Computers, Web Development, Linux, the Internet and the Like
Mac Browsers + PNGs = Mismatching Image Colors with Same HTML Hex
Most people with a Mac don’t know this but their gamma is set to 1.8 by default where the rest of the world is set to 2.2 for web/tv. The only reason I know this is because I had to figure out what was causing certain images to display darker on macs than Windows/Linux computers. Thankfully Don MacAskill, explained the basics of this “phenomenon” of Mac Browsers + PNGs = Mismatching Image Colors with Same HTML Hex” in great detail and with good examples
Internet standards, including HTML, CSS, and Flash, are based on a gamma of 2.2, making colors partway between black & white appear darker and higher contrast than 1.8 gamma makes them appear.
Clearly this is a problem, as referenced by Ron, even Apple recommends you change your default gamma from 1.8 to 2.2, where they also link to some further reading.
If images are delivered with the lower gamma information embedded, web browsers on macs tend to* (not all see note below) display them incorrectly if it’s not reading the color profile properly.
As a webdesigner / web developer / photographer, this might worry you. You’ll want it too look the same to everyone or at least the majority (95%+ of the world uses windows). The easiest way I found to fix this in my work flow, using Ubuntu Linux was with pngcrush, a cross-platform application that allows you to not only reduce image filesize loseless, but allows you to remove information that can cause confusion with the way images appear in mac web browsers.
All I had to do to install it on Ubuntu was:
sudo apt-get install pngcrush
Then I wrote the following command to strip all gAMA, cHTM, iCCP and sRGB information from all png files within a directory and move them to a folder called “crushed”
pngcrush -d crushed -rem gAMA -rem cHRM -rem iCCP -rem sRGB *.png
*It’s important to point out that this does not effect OSX 10.6+ (snow leopard and beyond). Further reading on why apple chose 1.8 gamma as the default can be found here.
| Print article | This entry was posted by Tyler Mulligan on May 28, 2010 at 6:30 am, and is filed under Computers, Graphics, OSX, Operating Systems, Software, The Internet, Web Applications, Web Development. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
No comments yet.
No trackbacks yet.

Retorting An Extremely Biased View Against Android
about 1 year ago - 11 comments
Introduction Those of you that have been following my blog for a while, know that I’m a big supporter of FOSS and Linux. It should come as no surprise then, that I have an Android phone. It’s not the best on the market by any means, it’s one of the first to appear on AT&T’s