[]RSS

About Archives Artwork Comic Contact Philosophy Projects Tags

Fixing PNG color matching for Safari and IE

[Comment]

August 7th, 2008 in Micro Blog

I spent a few minutes tonight figuring out why PNG files display differently on Safari (and IE6/7). It’s related to both gamma and colour space.

A partial solution:

pngcrush -rem cHRM -rem gAMA -rem iCCP -rem sRGB -d fixed/ *

The real solution:

There is no way of making PNG images that match CSS colors in all PNG-supporting browsers. This reduces the usefulness of the otherwise excellent image format. If the image colors and the colors defined in a style sheet need to match, it is safer to use GIF or JPEG. If you want to use PNG and don’t care about older browser versions (pre-Tiger Safari in particular), the best course of action is removing all the color space information from the PNG files. If you only want a match with the background color, you could make the background a PNG image as well. –The Sad Story of PNG Gamma “Correction”

IE6 CSS/Javascript/Caching bug

[Comment]

June 3rd, 2008 in Micro Blog

I ran into a well-known, but odd IE6 caching bug this week. If caching is turned off for IE6 browsers, modifying DOM elements triggers the browser to reload any resources referenced by the changed elements. So if a script changes the class name of 5 elements and the CSS classes have a background image property, then the background image will be reloaded once for each DOM update. This sucks the performance out of a web application.

There are several work arounds, but the best I’ve found is a simple IE6 Javascipt toggle that turns off the behaviour.