ewx: (Default)
Richard Kettlewell ([personal profile] ewx) wrote2007-03-07 01:15 pm
Entry tags:

More Firefox color woe

I complained a while ago about Firefox's broken color management on Macs. It turns out it's even more broken than that, and not only on Macs.

My home page has a gray background, set to 808080 hex in CSS. Embedded in it are some PNG images, again with a background color of 808080. So they should blend seamlessly into one another, right (whatever properties the browser thinks the monitor has, supposing it has an opinion at all)?

Display that page in Firefox 2.0 on Linux and here's (zoomed in) what you get:

Picking over that capture in the Gimp reveals that:

  • The CSS-configured background is actually rendered as a solid 848284
  • The background gray in the image is actually rendered as a randomly dithered pattern composed of 847d84 and 7b827b - at this magnification it looks visibly pink and green to my eyes though it's just a (visibly) different shade of gray without magnification.

(I initially spotted this on a Mac last night but assumed it was the same problem as before, perhaps compounded by using different interfaces for drawing background and images, but if it happens on Linux then too then it must be something fundamental to Firefox's treatment of color, probably far away from where you'd put color management support if the program actually had any).

[identity profile] imc.livejournal.com 2007-03-07 04:56 pm (UTC)(link)
I get solid #808080 using Firefox 1 or 2 on a 24-bit display.

Using Firefox 1.5.0.10 on a 16-bit display, xv tells me the background is a solid #808080 but the grey portion of the image is #788078 and #807c80. I believe xv is telling me the literal values displayed on screen while gimp is translating them to an #ffffff-based system, so that my values are the same as yours once that's taken into account.

So what it seems is happening is that the CSS-styled background colour is being simply truncated to fit into the screen's bit-depth while the image is being properly mapped to the correct colours and then dithered. (I wonder if dithering is strictly necessary on a 16-bit display. Can you turn it off?)