GNOME Bugzilla – Bug 728603
Remove clipping code from Addition, subtract, grain extract, and grain merge blend modes
Last modified: 2017-01-15 18:30:26 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 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.