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).
no subject
no subject
no subject
no subject
A 16-bit display, not 15? Well, no wonder it can't do pure greys sensibly then. That would certainly seem like a plausible cause to me. And it doesn't seem too surprising to me, either, that the CSS renderer and the PNG renderer disagree on the best way to approximate a pure grey with the available colours: the PNG renderer is already going to be prepared to dither where necessary, whereas the CSS renderer would have to go to some effort to include dithering code so it will just approximate to the nearest solid colour.
that the CSS renderer and the PNG renderer disagree
Re: that the CSS renderer and the PNG renderer disagree
The other alternative is to have the dithering done universally, so that the PNG renderer outputs 24-bit data all the time and some top-level piece of code deals in a uniform way with converting it to the available colour depth. That doesn't strike me as a nice answer either, because even on a 16-bit display it doesn't seem obviously right to dither the entire window without better cause than that.
Having mentioned alpha blending ... it suddenly occurs to me, actually, to ask why you're trying to match up those backgrounds at all. PNG has an alpha channel, so why haven't you just set the parts of the image which want to be the same colour as the surrounding page to transparent? That might perfectly well actually work better.
Re: that the CSS renderer and the PNG renderer disagree
Re: that the CSS renderer and the PNG renderer disagree
What it does is attach a proprietary filter, via CSS2 DOM events, to PNGs in IE only; this changes the particular renderer used for them to one which supports alpha channels. Grotesque, innit? :)
Re: that the CSS renderer and the PNG renderer disagree
The good cause for following the 'other alternative' is precisely the need to match up images and backgrounds. Like I say, this isn't some obscure edge case I'm trying to use here, it's something pretty widespread on the web.
Whether the globally used mechanism is dithering or just picking the nearest available color is another question, but it should certainly be the same mechanism for different sources of color.
Firefox seems to have no compunction about using visually bad (but computationally cheap) methods of scaling images, so it's not like cheap-and-cheerful color approximation would downgrade something that was otherwise a good graphical display tool.
(I can't remember why I ended up with a 16-bit display on this machine; I'll see what goes wrong with 24 bits, or whether it likes 15 bits, at some point. But having a workaround doesn't mean that the implementation is OK.)
no subject
Re: that the CSS renderer and the PNG renderer disagree
The PNG renderer appears to be attempting to maintain the luminance for each pixel, and maintain the colour averaged over a set of pixels. That's a pretty smart thing to do given the lower spatial frequency of our colour perception, but obviously isn't going to match the CSS.
I think an alpha channel is the way to go here. IE will almost certainly ignore it a show the grey, while Firefox and co will use it to let the background show through properly.
no subject
no subject
no subject
24 bit.
no subject
no subject
In which case, no, 808080 is not supposed to be web-safe -- the closest greys would be 666666 and 999999.
no subject
That pink-green combo makes my eyes bleed.
no subject
no subject
no subject
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?)