GNOME Bugzilla – Bug 773461
Color picker lacks L*a*b* mode
Last modified: 2017-06-12 16:30:59 UTC
I would like to see L*a*b* values in the Color Picker.
A LAB color picker panel would be very useful for many purposes. For general editing, I think an LCH color picker is even more useful than a LAB color picker (it's the same information, just run through a polar transform). Bug 749902 has code for implementing an LCH color picker, which code might also be useful as a model for implementing a LAB color picker. My patched version of GIMP (https://github.com/ellelstone/gimp) has a more up-to-date version of the code produced by the patch attached to Bug 749902, including code to allow using the Select by Color and Fuzzy Select tools using LCH instead of HSV.
Would we really need both LAB and LCH? LCH is on its way in, see bug 749902, I'd prefer to close this one as a duplicate. Opinions?
This bug is not a duplicate as LAB and LCH serve different though somewhat overlapping editing purposes. The usefulness of knowing and modifying LAB AB values is for things like adjusting A and B channels *individually* to restore neutrality at a given point, or to selectively enhance foliage colors, etc. The LCH Hue-Chroma tool and GEGL saturation modify both channels together. In current GIMP these sorts of adjustments can be made (somewhat awkwardly) using decompose to LAB, but not by directly editing in LAB space. Until/unless GIMP supports editing directly in LAB, with access to AB channel curves and such, personally I think a LAB color picker for GIMP isn't very useful. The PhotoFlow GIMP plug-in allows GIMP users to edit AB curves. I think the GMIC plug-in also does. The GEGL extract A or B components does allow to make masks to limit GEGL chroma and LCH hue-chroma adjustments to just the A or just the B channel. However currently GEGL extract A/B/C/H/L components gives wrong results (https://bugzilla.gnome.org/show_bug.cgi?id=755376).
> Would we really need both LAB and LCH? Yes.
(In reply to BugsBunny from comment #4) > > Would we really need both LAB and LCH? > > Yes. Do you want just the LAB readout? Or also the ability to modify LAB sliders to pick a color? If the latter, can you provide a couple of concrete examples showing how LAB sliders will be useful in an image editor such as GIMP 2.9/2.10 that doesn't allow to directly modify the AB channels?
I don't know what "the ability to modify LAB sliders to pick a color" means or what "LAB sliders" are. It's too vague. If photographers, especially professional ones, are part of the GIMP demographic, and https://gui.gimp.org/index.php/Vision_briefing says that they are, then being able to work in L*a*b* mode and to directly manipulate the L*, a* and b* channels with a live preview is not a question of if but when. I work in L*a*b* every day (and look forward to the day when I can use GIMP for that), and match L*a*b* values to a reference value at least once a week. I don't remember what I was specifically trying to do last October when I opened this issue. Whatever it was, it required knowing the L*a*b* values to know how far off the image was from the reference. Even if GIMP doesn't yet allow me to modify the L*a*b* channels directly, at least telling me what the values are is a step in the right direction. And if there is no intention of letting GIMP users directly manipulate L*a*b* channels or even know L*a*b* values, then please change the "Vision briefing" to not mislead people into thinking GIMP is something which it isn't.
(In reply to BugsBunny from comment #6) > I don't know what "the ability to modify LAB sliders to pick a color" means > or what "LAB sliders" are. It's too vague. GIMP 2.9 already has the ability to pick colors, display values, and modify the Foreground/Background colors using HSV, RGB, and also CMYK. When bug 749902 is closed, GIMP will also be able to pick/display/modify using LCH. GIMP can already display (sample points and pointer dialogs) LCH colors and modify the colors in a layer using LCH (the LCH hue-chroma tool). The last step is to add the LCH sliders to the FG/BG panel. These sliders will look something like the sliders in this image: https://bug749902.bugzilla-attachments.gnome.org/attachment.cgi?id=351905 > If photographers, especially professional ones, are part of the GIMP > demographic, and https://gui.gimp.org/index.php/Vision_briefing says that > they are, then being able to work in L*a*b* mode and to directly manipulate > the L*, a* and b* channels with a live preview is not a question of if but > when. I more or less agree with you, though there are people who would vehemently disagree. But I'm not sure what such would involve coding-wise - it would probably involve babl and GEGL as well as GIMP. I'm guessing this is not an easy coding task that could be done in time for 2.10. > I work in L*a*b* every day (and look forward to the day when I can use GIMP > for that), and match L*a*b* values to a reference value at least once a week. > > I don't remember what I was specifically trying to do last October when I > opened this issue. Whatever it was, it required knowing the L*a*b* values to > know how far off the image was from the reference. Even if GIMP doesn't yet > allow me to modify the L*a*b* channels directly, at least telling me what > the values are is a step in the right direction. I *think* the ability to use the sample points and pointer to display LAB values would be simple to add to 2.9/2.10. It might even be easy to add a LAB readoutto the Change Foreground tool somewhat like we already have an html color code read-out.
(In reply to Elle Stone from comment #7) > I *think* the ability to use the sample points and pointer to display LAB > values would be simple to add to 2.9/2.10. > I'm working on a patch to do this, fwiw.
(In reply to Elle Stone from comment #8) > (In reply to Elle Stone from comment #7) > > > I *think* the ability to use the sample points and pointer to display LAB > > values would be simple to add to 2.9/2.10. > > > > I'm working on a patch to do this, fwiw. Well, I managed to add LAB to the options for the Sample Points and Pointer dialogs, but the LAB values aren't correct, I think I'm not using the fish correctly, or maybe the wrong formatting, or probably both.
Created attachment 352019 [details] [review] Add LAB readout to Pointer and Sample Points dialogs
(In reply to Elle Stone from comment #10) > Created attachment 352019 [details] [review] [review] > Add LAB readout to Pointer and Sample Points dialogs This patch allows to see LAB values in the Pointer/Sample Points dialog. But I'm not sure if this is all that's being requested in this particular bug report. Bug 309485 requests LAB as a new color mode. Also bug 432933 comment 5 (https://bugzilla.gnome.org/show_bug.cgi?id=432933#c5) suggests to add LAB to the Curves (and Levels?) dialogs. One can use LCH Hue-Chroma tool to move the AB values of any given color - Changing Chroma moves the color's location on the AB plane towards and away from A=B=0. Changing Hue rotates the color's location on the AB plane at a constant distance from A=B=0. But using LCH to adjust AB changes *all* the colors in the layer by the same amount. LAB AB Curves allows to adjust a given color's AB values, but have the amount of the adjustment fade to zero the further any given color is from the selected color. For people who are used to doing color correction in LAB space, this is a critically important option.
Review of attachment 352019 [details] [review]: That looks perfect, please push, but change the git log summary to: Bug 773461 - Color picker lacks L*a*b* mode
commit 127e7daeb2654569d44834822a2af8769449c103 Author: Elle Stone <ellestone@ninedegreesbelow.com> Date: Wed May 17 10:27:53 2017 -0400 Bug 773461 - Color picker lacks L*a*b* mode Add LAB readout to Pointer and Sample Points dialogs app/widgets/gimpcolorframe.c app/widgets/widgets-enums.c app/widgets/widgets-enums.h
Thank you very much!
Created attachment 352155 [details] Maybe add LAB color selector? Given that sometimes a user will have LAB values from various sources and will want a way to easily convert from LAB to RGB, LCH, or their selected CMYK color space, it might be nice to add LAB sliders to the color selecting tools. The attached jpeg shows two possible locations to add LAB sliders - either below the new CH sliders or else as a separate panel like the CMYK panel - below the CH sliders might be the better choice. If adding LAB sliders seems like a good thing to do, I can try to write the additional code for whichever location seems most appropriate. Otherwise I think this bug report can be closed.
If we add LAB sliders, i would prefer them to be in the big list of sliders. But then we need some dropdown at the top to choose which set of sliders to show at all, and then we can also keep HSV permanently in that dropdown. Let's leave this open for now.
Let's close this one a FIXED, the "hiding color models from the list of sliders issue" just got a bug for itself: bug 783680.