The Treachery of PNG Images

These two images are not the same, at least if you are using the default Firefox configuration on Linux/X11 with gfx.color_management.mode set to 2 (only tagged) instead of 0 (all disabled). It turns out I disabled that setting entirely at some point—for some reason—and later forgot about it.

To be more specific, the image to the right is the intended rendering. This is what the side-by-side comparison above should look like with the defaults.

It also seems I have been leaving behind a trail of PNG files in the web that contain bogus ICC information that causes Firefox—again, with the default configuration—to render them differently than I actually intended when exporting them in the GIMP. In the case of my avatar, it’s not a big deal since it’s just Xykon from the Order of the Stick serving as my terrifying spokesman spokeslich. However, if my memory serves me right I have seen this being an actual issue with my whole website layout in my default-configured virtual machines — and I always dismissed that color disparity as being caused by VirtualBox instead of Firefox.

Thankfully, the website CSS currently makes more use of browser gradients to prevent the faulty (?) graphics being used in practice. The spritesheet that contains the post category icon (used in the front page) is evidently affected, though.

But to what degree is it Firefox’s fault? Unfortunately, I understand jack shit about color profiles and I don’t seem to have a tool handy to tell me what the technical differences between both images are. I suspect I did something wrong in the GIMP at some point, or perhaps the problem was created by my application of a certain PNG optimization script. Does the wrongly rendered version of my avatar actually have color profile information in it?

What I do understand is that color profile information in PNG files has bitten my ass several times over the years, and not just with Firefox, but also with Wesnoth (via SDL_image).

If anyone there thinks they have a definitive answer to this conundrum, please share.

EDIT: Yes, I reuploaded my avatar to the Wesnoth.org forums and my Twitter profile during the last couple of days in order to fix this issue. It was just matter of opening importing the current versions in the GIMP and then saving exporting the unaltered contents to new files. I will probably try the optimization procedure on the fixed versions later.

EDIT 2: Also, yes, I am aware that the two sample images look identical in non-Gecko browsers.