After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599065 - PNG output: omit unwanted chunks (sRGB)
PNG output: omit unwanted chunks (sRGB)
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.7
Other All
: Normal enhancement
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on: 608961
Blocks:
 
 
Reported: 2009-10-20 16:15 UTC by bobince
Modified: 2011-02-02 07:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bobince 2009-10-20 16:15:24 UTC
I don't know when this started happening, but GIMP 2.6.7 (here in Ubuntu Karmic beta) is saving all PNGs with some chunks that are likely to be pointless (bKGD on an image with no alpha; pHYs; tIME), and one in particular that is actively harmful: sRGB. This happens even when colour management is disabled in the preferences, and it puts the chunks back in even when editing a PNG that originally didn't have them.

*This is an absolute disaster for web authors.* sRGB doesn't help retain any colour information (being as it is an arbitrary uncalibrated colour space), but it *does* nicely screw up rendering in web browsers. The situation with gAMA on the web is bad enough without introducing this extra obstacle.

Having to pngcrush every file after every edit is an absurd situation. Please include a checkbox on the PNG export to omit these chunks, and disable sRGB by default. It represents nothing more than a stealthy trap and impediment to GIMP use for web designers.
Comment 1 Martin Nordholts 2009-10-20 17:41:46 UTC
I agree that we are currently setting an sRGB color profile rather arbitrary. Let's try to come up with a better strategy for 2.8.
Comment 2 Simon Budig 2009-10-21 14:29:47 UTC
I am tempted to close this bug and wait for a better description of the actual problem.

The Chunks mentioned in the report can be individually controlled in the plugin dialog, the default set of chunks can be stored in the preferences.

Ok, sRGB probably is a quite notable exception to that, but then it actually is the working space of GIMP and I don't understand why it would be an "arbitrary uncalibrated colour space" (it *is* well defined). And up to now this is the first complaint I hear about this, which makes it unlikely to be an absilute disaster.

*shrug*
Comment 3 bobince 2009-10-21 16:50:29 UTC
OK, I seem to be mistaken about the other chunks; I can't reproduce them getting added when the options are turned off now.

But the sRGB problem is easy to see. Create a new image blue.png of solid blue, save and put it on top of a <body bgcolor="#0000FF">. On Firefox 3.5 under Ubuntu at least (and, according to the tests at http://hsivonen.iki.fi/png-gamma/, other browsers too), the colours will fail to match (by quite some way).

It is widely accepted that PNGs for web use should be unlabelled (no specified colour space).
Comment 4 Martin Nordholts 2009-10-21 17:07:30 UTC
Right now we set sRGB on the PNG if there is no gamma value set. This is not the first complaint we have had about this, it's more like the tenth (including complaints in #gimp).

If I recall correctly me and Sven already talked about this and agreed to do something about it, although right now I don't remember what it was, but I'm pretty sure I can figure it out again when I do a git blame.

Keeping this bug report open is a simple way to remind ourselves of that we need to do something. We could close this and create a new bug report, but I don't see the point in doing that, might as well reuse this one.
Comment 5 Martin Nordholts 2010-01-23 07:11:00 UTC
Here is a thread where this was discussed:
http://lists.xcf.berkeley.edu/lists/gimp-developer/2009-February/021581.html
Comment 6 smartboyathome 2010-09-12 04:31:00 UTC
This may be an older bug, but it still very much hurts myself as a web developer. I have used GIMP loyally for a while to do web development work, but in more recent Firefox versions it does break when trying to use images created with GIMP with other, HTML-set colors. Not even the save for web plugin has the ability to fix this, which I had hoped would. Anyway, PLEASE fix this since it so that GIMP is usable for the web again.

By the way, the commit by Omari Stephens in January (can be seen at http://codepad.org/7e3cWDhm ) doesn't seem to fix this. I patched GIMP, recompiled then reinstalled, but still it saves images with the sRGB bit. I checked them with Firefox, and indeed its showing the image with colors off by a lot.
Comment 7 smartboyathome 2010-09-12 05:13:20 UTC
Actually scratch that last comment, Omari's patch does work, I just forgot to change a setting back in Firefox. Still, this bug did make it a pain without the patch. :\
Comment 8 Martin Nordholts 2011-02-02 07:34:47 UTC
I recently got burned by this behavior and got tired of it, so I push this commit:

commit ed872c7c6e53a187e76e06f9a081c91370466f92
Author: Omari Stephens <xsdg@xsdg.org>
Date:   Sun Jan 30 21:34:19 2011 +0100

    Bug 599065 - PNG output: omit unwanted chunks (sRGB)
    
    If the image has neither a gamma set nor a color profile set, then we
    should leave the image untagged. We should not tag as sRGB by default
    because it is too arbitrary.

This can be seen as a quick-fix before we have a consistent strategy for handling exporting and color profiles for the various file formats we support.