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 723498 - Gimp changes contrast and color of images
Gimp changes contrast and color of images
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.8.10
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2014-02-03 00:36 UTC by Luis A. Florit
Modified: 2017-01-31 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Animation showing difference between RawTherapee output and GIMP input (190.51 KB, image/gif)
2014-02-03 00:47 UTC, Luis A. Florit
Details
Screenshot of the same image displayed in GIMP and RawTherapee (127.91 KB, image/jpeg)
2015-11-20 14:42 UTC, Elle Stone
Details
Test image for checking how image display in different editors (32.19 KB, image/jpeg)
2015-11-20 15:01 UTC, Elle Stone
Details

Description Luis A. Florit 2014-02-03 00:36:16 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.
Comment 1 Luis A. Florit 2014-02-03 00:40:29 UTC
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.
Comment 2 Luis A. Florit 2014-02-03 00:42:21 UTC
BTW, I have reported in the past a rounding error bug in GIMP.
This also could be a rounding problem.
Comment 3 Luis A. Florit 2014-02-03 00:47:24 UTC
Created attachment 267896 [details]
Animation showing difference between RawTherapee output and GIMP input
Comment 4 Michael Schumacher 2014-02-08 12:56:08 UTC
Can you attach the original image(s)?
Comment 5 Luis A. Florit 2014-02-11 16:44:34 UTC
(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.
Comment 6 Michael Schumacher 2015-06-06 17:17:34 UTC
Does this still happen with 2.8.14?

And given the changes there, this should also be checked in Git master.
Comment 7 Elle Stone 2015-11-20 14:30:32 UTC
(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.
Comment 8 Elle Stone 2015-11-20 14:42:20 UTC
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.
Comment 9 Elle Stone 2015-11-20 15:01:52 UTC
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.
Comment 10 Michael Natterer 2015-11-24 00:10:32 UTC
I see, but we could at least tag screenshots taken with GIMP with the
monitor profile.
Comment 11 Elle Stone 2015-11-24 16:38:15 UTC
(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.
Comment 12 Michael Natterer 2017-01-31 20:33:35 UTC
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(-)