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 757783 - When opening linear gamma pngs or tiffs, many operations give wrong results
When opening linear gamma pngs or tiffs, many operations give wrong results
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2015-11-08 16:50 UTC by Elle Stone
Modified: 2015-11-23 21:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
linear gamma sRGB 16-bit integer png (88.82 KB, image/png)
2015-11-08 20:49 UTC, Elle Stone
Details
32-bit floating point tiff (304.87 KB, image/tiff)
2015-11-08 20:50 UTC, Elle Stone
Details
linear gamma sRGB red and green blocks for checking for gaussian blur errors (1.40 KB, image/png)
2015-11-08 20:51 UTC, Elle Stone
Details
shows the gaussian blur error when blurring a linear gamma sRGB tiff or png (65.17 KB, image/png)
2015-11-08 20:53 UTC, Elle Stone
Details

Description Elle Stone 2015-11-08 16:50:30 UTC
When opening a true linear gamma sRGB png or tiff (and any other file format that GIMP doesn't assume should be linear), all editing operations that request RGB/A or Y/A produce wrong results. This is because all such operations request that the RGB data be "linearized" from an assumed sRGB TRC. "Linearizing" already linear RGB produces approximately gamma=0.45-encoded RGB. 

See https://mail.gnome.org/archives/gimp-developer-list/2015-November/msg00003.html for details.
Comment 1 Michael Natterer 2015-11-08 17:11:43 UTC
Please attach such a (small) true linear PNG and TIFF here, so we can
at least make sure it's loaded into the correct GEGL buffers.
Comment 2 Elle Stone 2015-11-08 20:49:29 UTC
Created attachment 315093 [details]
linear gamma sRGB 16-bit integer png
Comment 3 Elle Stone 2015-11-08 20:50:09 UTC
Created attachment 315094 [details]
32-bit floating point tiff
Comment 4 Elle Stone 2015-11-08 20:51:28 UTC
Created attachment 315095 [details]
linear gamma sRGB red and green blocks for checking for gaussian blur errors
Comment 5 Elle Stone 2015-11-08 20:53:18 UTC
Created attachment 315096 [details]
shows the gaussian blur error when blurring a linear gamma sRGB tiff or png
Comment 6 Michael Natterer 2015-11-23 17:46:11 UTC
Fix PNG loading:

commit 3cc80b0a5c630c70b5989f45e68c3f4f4c925215
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Nov 23 18:44:17 2015 +0100

    Bug 757783 - When opening linear gamma pngs or tiffs...
    
    ...many operations give wrong results
    
    Fix PNG loading to get the embedded profile first, and create a
    linear RGB image if the profile says so.

 plug-ins/common/file-png.c | 220 +++++++++++++++++++++++++++++++++------------------------------
 1 file changed, 115 insertions(+), 105 deletions(-)
Comment 7 Michael Natterer 2015-11-23 21:31:26 UTC
And fixed for TIFF:

commit bc980cd73aea795dea1e453cb403c33c1f63375b
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Nov 23 22:29:06 2015 +0100

    Bug 757783 - When opening linear gamma pngs or tiffs...
    
    ...many operations give wrong results
    
    Same fix for TIFF: get the color profile first, then create a linear
    image if the profile says so.

 plug-ins/common/file-tiff-load.c | 437 +++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 281 insertions(+), 156 deletions(-)