Dark PNGs in Safari

For whatever reason, sometimes the transparent parts of PNGs appear darker in Safari than in other browsers.  You can fix it by removing all the color correction metadata from the images with pngcrush:

pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB InputFile.png OutputFile.png

pngcrush is a command line tool that optimizes (read: makes smaller) PNG images. You can find out more about it on Wikipedia. I use it on OSX via MacPorts.

For normal PNG optimization, I actually prefer to use OptiPNG because it can optimize a whole directory of images with a simple command:

optipng ./*.png

OptiPNG overwrites the existing files with the new smaller files without any loss in quality. Good deal! Fast, easy, awesome. To bad it can’t remove that stupid color correction data though.

This entry was posted in Solutions, Web Design. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>