GNOME Bugzilla – Bug 499794
decompose plug-in does not take ICC profile of image into account
Last modified: 2018-05-24 12:16:53 UTC
Please describe the problem: The following functions in plug-ins/common/decompose.c use fixed formulas to convert the RGB data in the image to Lab or several variants of YCbCr: extract_lab, extract_ycbcr470, extract_ycbcr709, extract_ycbcr470f, extract_ycbcr709f, (maybe more) These fixed formulas are probably only valid if the image data is in sRGB. They will work incorrectly if a different color profile is used for the image data. Instead of fixed formulas, functions in the lcms color management library should be used to correctly convert the data. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
If someone wants to make a patch for that with optional code that is only used if lcms is available, that would certainly be appreciated. But this is not a bug. You should not use anything but sRGB as your working color space in GIMP or things will simply not work correctly, just as you experienced here. I am not even sure if we should keep this as an enhancement request.
If GIMP only supports sRGB as a working color space, then that's indeed a much bigger problem than this...
We only just added basic support for color management and almost all of the code assumes sRGB. There are many operations where this is not a problem so it does make sense to keep images in other RGB color spaces. But most often it is preferred to convert to sRGB when opening the file. Anyway, using lcms from the compose and decompose plug-ins would probably be a nice improvement, so feel free to contribute a patch.
Note that not only Decompose, but also the Compose plug-in has this limitation.
Yes, both plug-ins are closely related and if one is changed to (optionally) use lcms, then the other needs to be changed as well.
(In reply to Sven Neumann from comment #3) > We only just added basic support for color management and almost all of the > code assumes sRGB. There are many operations where this is not a problem so > it does make sense to keep images in other RGB color spaces. But most often > it is preferred to convert to sRGB when opening the file. > > Anyway, using lcms from the compose and decompose plug-ins would probably be > a nice improvement, so feel free to contribute a patch. This bug report was made back in 2007, when basic support for color management had just been added to GIMP. Now it's 2016 and GIMP still contains hard-coded sRGB parameters that prevent getting correct editing results in color spaces other than sRGB. See https://bugzilla.gnome.org/show_bug.cgi?id=737778. Unfortunately the patch I attached to https://bugzilla.gnome.org/show_bug.cgi?id=737778 still doesn't work when the image is decomposed to LAB from an image that's in a color space other than sRGB. The patch produces correct results for most editing operations, including the LCH blend modes, but not for decomposing to LAB or LCH.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/258.