[PNG icon] Browser Gamma-Consistency Test

These pages were created in order to test the self-consistency of web browsers' gamma correction. In brief, if they gamma-correct HTML colors on non-sRGB systems (which would be proper, according to the HTML 4.01 specification), then they should gamma-correct unlabelled images in the same way. If they gamma-correct CSS colors on non-sRGB systems (which is required, according to the CSS Level 1 specification), then they also should gamma-correct unlabelled images in the same way.

Alternatively, if they don't gamma-correct HTML or CSS colors (which is current practice in almost all web browsers and is conformant behavior in HTML 4.01 but not in CSS), then they should not gamma-correct unlabelled images, either. In the latter case, however, labelled images (such as PNGs with a gAMA, cHRM, sRGB or iCCP chunk, or JPEGs with an ICC profile marker) are unlikely to match the HTML colors across all platforms--and, depending on where the images were created, possibly not on any platform.

Currently 12 test pages are available. In all but the 1/1.6 and ICC (1/1.0) pairs, the RGB palette values encoded in the images are identical to the RGB hex values used for the table cells; in other words, in eight of the cases, doing no gamma correction on anything will produce self-consistent results on all systems (though with considerable variance between different systems). Doing gamma correction only on the PNG images will produce self-consistent results for all of the tests if and only if the browser believes the display system to be sRGB-like (as on virtually all Windows and Unix PCs); on non-sRGB systems, none of the PNGs will match the background colors. Similar results would hold for browsers that gamma-correct only the CSS colors.

[sRGB PNGs on CSS]

The test suite is also available as a downloadable archive in either gzip'd tar format or zipfile format:


The browsers mentioned in this section have not been retested since the second millenium C.E.

How do the major browsers fare on the gamma-consistency suite? Overall, not so well. Here are some results for Netscape Navigator 4.7, Mozilla 2000-09-26-06-M18 (which is what was used for the screenshot above, title bar notwithstanding), and Internet Explorer 5.0. The three were tested on sRGB displays, which in all but the 1/1.6 case [the ICC/1.0 case was added much later] means the appearance of the images would match the appearance of the table cells if the browser failed to do any gamma correction at all:

   test page                                    NN4     Moz     IE5
   ---------                                    --      --      --
   Unlabelled GIFs on HTML colors:              OK      OK      OK
   Unlabelled GIFs on CSS colors:               no*     OK      
   Unlabelled PNGs on HTML colors:              OK      OK      OK
   Unlabelled PNGs on CSS colors:               no*     OK      
   Gamma-labelled PNGs (1/1.6) on HTML colors:  no      OK      no
   Gamma-labelled PNGs (1/1.6) on CSS colors:   no*     OK      no
   Gamma-labelled PNGs (1/2.2) on HTML colors:  OK      OK      no
   Gamma-labelled PNGs (1/2.2) on CSS colors:   no*     OK      no
   sRGB-labelled PNGs on HTML colors:           OK      OK      OK?
   sRGB-labelled PNGs on CSS colors:            no*     OK      OK?

   no* = doesn't support CSS
   OK? = looks OK, but doesn't match 1/2.2 case => ignoring sRGB chunk?

In this table, OK or no refers only to whether the colors match--i.e., whether or not the handling of gamma is consistent--not to whether the browser does gamma correction in the first place. Hence NN 4.7's results: it doesn't do gamma correction, and therefore its results look good in four out of the five HTML cases. (It also doesn't do CSS when JavaScript is disabled, which is why it failed in the remaining five test cases. It has not been retested with JavaScript and CSS enabled.)

Mozilla appears to be fully conformant (except for the newly added ICC-profile images), but keep in mind that this was on an sRGB system. On a Macintosh, it was reported to fail in all but the two GIF cases, which would make sense: as of late 2000, it gamma-corrected only PNGs (bug 53597). A patch has been submitted to extend gamma correction to GIFs, JPEGs, and both HTML and CSS colors, but it did not get into the initial NN 6.x releases (and the browser has not be retested since then).

MSIE 5.0 is an interesting case. Initially it appeared to match the non-gamma-correcting results of NN 4.x, but the two gamma 1/2.2 cases belie that appearance. It is doing something to the PNG colors, but clearly not the same thing as to the HTML and CSS colors. (Best guess: it gamma-corrects only the PNGs, but it assumes a display gamma of something other than 2.2--perhaps 2.0?)


Here are some related PNG pages at this site:


[primary site hosted by SourceForge.net] Last modified 21 August 2005.

Copyright © 2000-2005 Greg Roelofs.