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 728603 - Remove clipping code from Addition, subtract, grain extract, and grain merge blend modes
Remove clipping code from Addition, subtract, grain extract, and grain merge ...
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: 2014-04-20 12:19 UTC by Elle Stone
Modified: 2017-01-15 18:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to unclip addition, subtract, grain extract and grain merge blend modes (2.66 KB, patch)
2014-04-20 12:19 UTC, Elle Stone
reviewed Details | Review

Description Elle Stone 2014-04-20 12:19:19 UTC
Created attachment 274754 [details] [review]
patch to unclip addition, subtract, grain extract and grain merge blend modes

Addition, subtract, grain extract, and grain merge blend modes do work in unbounded mode sRGB if the clipping code is removed.

I find having these blend modes unclipped very convenient and useful.

Even when working in the source color space rather than unbounded mode sRGB, removing the clipping code makes certain editing moves possible and easy that otherwise are impossible.

There are times when clipping to 1.0 and/or 0.0 is a useful thing to do. I forget the context but while testing fourier transforms for lens blurs, at one point I did want to clip the data to white. 

Unfortunately clipping in unbounded mode sRGB means clipping to the bounded mode sRGB color gamut, when really what the user likely wants to do is clip to the color gamut of the source color space. For which problem a linear gamma color space based on the chromaticities of the source color space would be the solution.

Regarding grain extract and grain merge, the "middle point" used in the code is 0.5. I'm not sure why that value was picked. The only tone reproduction curve for which 0.5 is the exact perceptual center is the lstar tone reproduction curve. 

For the regular sRGB TRC, the perceptual center is 0.466329.

For the linear gamma TRC, the perceptual center is 0.184187 (18% gray).

I've been experimenting with using these alternative values as the middle point for grain extract and grain merge. These two blend modes are amazingly useful, but I haven't reached any conclusions about the proper middle point, 0.5 vs 0.466329 vs 0.184187. Does anyone have insight on this question?
Comment 1 Michael Schumacher 2017-01-15 18:30:10 UTC
Comment on attachment 274754 [details] [review]
patch to unclip addition, subtract, grain extract and grain merge blend modes

CLAMP is gone from the current modes. The changes done supersede this patch.