GNOME Bugzilla – Bug 723498
Gimp changes contrast and color of images
Last modified: 2017-01-31 20:33:35 UTC
After opening a file, GIMP changes its color and contrast. For example, the images sent by RawTherapee look different in GIMP, even when using the very same ICC profiles. In addition and related to this, after taking a Screenshot of an image in GIMP main window, the opened screenshot has different colors and contrast to the original one, even if a single color patch is used as an image.
Example: open a 300x300 pixel image, and fill it with solid #747df3. I get a screenshot of that patch with GIMP and read the new color: changed to #7a7bf1. A screenshot of the screenshot gives me #7f79ef. A further screenshot of the screenshot of the screenshot gives #8377ed. All four patches are subtly but visibly different.
BTW, I have reported in the past a rounding error bug in GIMP. This also could be a rounding problem.
Created attachment 267896 [details] Animation showing difference between RawTherapee output and GIMP input
Can you attach the original image(s)?
(In reply to comment #4) > Can you attach the original image(s)? Sure, you can download it from here (the system does not allow me to upload such a big file): http://luis.impa.br/photo/lixo/EnseadaDePalmas_IlhaGrande-RJ-131228-E_38641.orf But any image would do it, but it is more obvious if it has contrasty shadows.
Does this still happen with 2.8.14? And given the changes there, this should also be checked in Git master.
(In reply to Luis A. Florit from comment #1) > Example: open a 300x300 pixel image, and fill it with solid #747df3. > I get a screenshot of that patch with GIMP and read the new color: changed > to #7a7bf1. > A screenshot of the screenshot gives me #7f79ef. > A further screenshot of the screenshot of the screenshot gives #8377ed. > All four patches are subtly but visibly different. Hmm, well, the problem is as follows: A screenshot doesn't have an embedded ICC profile. So GIMP 2.9 assigns the GIMP built-in sRGB profile (other software might assign various other profiles or versions of the sRGB profile, depending on the user's color management settings). But the GIMP built-in sRGB profile isn't the correct profile to assign to a screenshot. The correct profile to assign to a screenshot is the monitor profile that was used by the software that was displaying the image when the screenshot was made. So to get the colors from a screenshot taken using GIMP, to match the image as displayed in GIMP: 1. Make the screenshot. 2. In GIMP 2.9, change the precision to 32-bit floating point to minimize color loss from ICC profile conversions. 3. Assign the monitor profile that was specified in the Color Management Preferences. 4. Convert the image to the GIMP built-in sRGB profile. For GIMP 2.9, it might be nice if screenshots taken with GIMP would provide an option to automate these four steps.
Created attachment 315972 [details] Screenshot of the same image displayed in GIMP and RawTherapee After making sure all profile and color management settings match in GIMP and Rawtherapee, the images look pretty much identical.
Created attachment 315974 [details] Test image for checking how image display in different editors Using GIMP 2.9, I made screenshots of the attached test image as displayed by darktable, Krita, Geeqie, RawTherapee, ShowFoto, and GIMP 2.9. After assigning the monitor profile to the various screenshots, converting them all to 32-bit floating point and then to the GIMP built-in sRGB profile, and stacking the screenshots in an XCF file, all the screenshots are visually identical. When set to "Difference" blend mode at 8-bit precision (the precision at which the screenshot was made), color picking around shows that most colors are identical in all the screenshots, and a sprinkling of colors vary by 1 in one channel. So basically there doesn't seem to be any bug here at all. Everything seems to be working exactly as it should.
I see, but we could at least tag screenshots taken with GIMP with the monitor profile.
(In reply to Michael Natterer from comment #10) > I see, but we could at least tag screenshots taken with GIMP with the > monitor profile. That might be a nice thing to do. People have asked me how I make screenshots match pictures as displayed by image editors, so I will guess that the connection between the screenshot and the monitor profile isn't exactly well known. As far as RawTherapee goes, I think there might be situations where RT does display different colors than other image editors (including but not limited to GIMP). The solution is to make sure *all* the relevant RawTherapee profile and conversion settings match the other software's settings, but I'm not sure this solution covers all differences, all the time.
This adds profile handling to the screenshot plug-in. I'm calling this FIXED because this was only a side-issue of the original report, and the below-mentioned multi-monitor problems probably count as separate issues: commit e518b9753dd4f23edec79a8b525c26aafc9cdf1e Author: Michael Natterer <mitch@gimp.org> Date: Tue Jan 31 21:26:44 2017 +0100 Bug 723498 - Gimp changes contrast and color of images Add color management options to the screenshot plug-in: By default, it tries to tag the image with the monitor profile; alternatively, there is an option to convert the image to sRGB. This works mostly fine on *one* monitor given its profile is configured correctly. With more than one monitor, funny things happen depending on the platform and on what we are shooting (window, screen, area). There are some FIXMEs left in the code. plug-ins/screenshot/screenshot-gnome-shell.c | 20 +++++++++ plug-ins/screenshot/screenshot-osx.c | 3 ++ plug-ins/screenshot/screenshot-win32.c | 70 ++++++++++++++++++++----------- plug-ins/screenshot/screenshot-x11.c | 44 ++++++++++++++------ plug-ins/screenshot/screenshot.c | 92 +++++++++++++++++++++++++++++------------ plug-ins/screenshot/screenshot.h | 26 ++++++++---- 6 files changed, 183 insertions(+), 72 deletions(-)