GNOME Bugzilla – Bug 780065
Change the default way to desaturate a layer from Lightness to Luminance
Last modified: 2017-03-17 21:27:22 UTC
Created attachment 347958 [details] [review] Change default way to desaturate a layer from Lightness to Luminance This patch does three things: 1. Changes the default "pre-chosen" way to desaturate (Colors/desaturate/desaturate) from Lightness (the HSL version of Lightness) to Luminance. Unlike HSL "Lightness", "Luminance" is actually physically meaningful and also generally speaking much more useful than HSL Lightness. 2. Changes the menu entry that the user sees from "Lightness" to "Lightness (HSL)" to make it clear that the "Lightness" in the Colors/desaturate/desaturate menu is not the same as "Lightness" in LAB/LCH. 3. Adds links in app/operations/gimpoperationdesaturate.c to the Wikipedia article with definitions of the L/I/V parameters in HSL/HSI/HSV. The goals of this patch are: 1. Make it easier for users to get technically correct results 2. Forestall any user confusion about the difference between LAB/LCH Lightness and HSL Lightness: * When RGB Luminance is converted to LAB/LCH, you get LAB/LCH Lightness. These conversions to black and white are color-space independent and have "real world" counterparts. * HSL Lightness, and also HSI Average/Intensity, and also HSV Value, are not color-space independent and have no real-world counterpart, being designed for fast calculation on slow computers from the 1990s. It might be nice to also rearrange the menu items on the "Colors/desaturate/desaturate" menu from the current listing order of: Lightness Luma Average Luminance to a "from better/more meaningful to worse/less meaningful" listing: Luminance Luma Lightness (HSL) ( average of MAX (R,G,B) + MIN (R,G,B) ) Average (HSI) ( average of R, G, and B ) Not that I'm recommending this, but for the sake of completeness Value (HSV) ( MAX (R,G,B) ) could be added to the available conversion options, thus covering all the standard old ways to convert to black and white, that sometimes users might find useful, and especially when following old tutorials.
I think all of this makes sense, also adding the "missing" methods of conversion, given they are ordered in a sane way. Do you want to enhance the patch? I can take care of reordering the enum in the GUI.
Yes, I'll add the missing method "Value (HSV)". Would it make sense to change the description "Average (HSI)" to "Intensity (HSI)"? This would preserve the pattern of "Component Name (Color Model)"
Yes I think so, go ahead. If there are lots of complaints we can always change the label again, but I doubt there will be :)
Created attachment 348005 [details] [review] Change default way to desaturate an image My apologies, this also changes the order in which the items appear, which I did as part of adding the Value (HSV) option. I suspect there shouldn't be any modifications in the patch to app/pdb/color-cmds.c or app/pdb/drawable-color-cmds.c, and maybe not to tools/pdbgen/enums.pl - should I make a patch that doesn't modify these files?
Created attachment 348082 [details] [review] Change default way to desaturate Hopefully this is right. I have a question about line 109 of the patch, for "static const GEnumValue values[]" in the file gimpbaseenumns.c which currently reads: { GIMP_DESATURATE_AVERAGE, "GIMP_DESATURATE_AVERAGE", "average" }, I think "average" really should be "average" rather than "intensity", even though the descriptions are changed to "Intensity (HSI)", yes?
Created attachment 348208 [details] [review] Change default way to desaturate from Lightness to Luminance Per IRC the name "Intensity (HSI)" has been changed to "Average (HSI Intensity)", and the order of the code in the process function matches the enums.
commit 48e40446729534a43f6673429018296e30cf9cd5 Author: Elle Stone <ellestone@ninedegreesbelow.com> Date: Fri Mar 17 16:20:40 2017 -0400 Bug 780065 - Change default way to desaturate to Luminance which unlike HSL Lightness is actually physically meaningful and also generally speaking much more useful than HSL Lightness. Change "Lightness" to "Lightness (HSL)" to make it clear that the "Lightness" in the Colors/Desaturate/Desaturate menu is not the same as "Lightness" in LAB/LCH. For completeness add the option to desaturate to "Value (HSV)". Add links in app/operations/gimpoperationdesaturate.c to the Wikipedia article with definitions of L/I/V in HSL/HSI/HSV. app/operations/gimpoperationdesaturate.c | 29 ++++++++++++++++++++++++++++- libgimpbase/gimpbaseenums.c | 6 ++++-- libgimpbase/gimpbaseenums.h | 9 +++++---- tools/pdbgen/enums.pl | 6 ++++-- 4 files changed, 41 insertions(+), 9 deletions(-)