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 773461 - Color picker lacks L*a*b* mode
Color picker lacks L*a*b* mode
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal enhancement
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-10-25 08:24 UTC by BugsBunny
Modified: 2017-06-12 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add LAB readout to Pointer and Sample Points dialogs (3.27 KB, patch)
2017-05-17 10:54 UTC, Elle Stone
accepted-commit_now Details | Review
Maybe add LAB color selector? (91.75 KB, image/jpeg)
2017-05-19 12:29 UTC, Elle Stone
  Details

Description BugsBunny 2016-10-25 08:24:39 UTC
I would like to see L*a*b* values in the Color Picker.
Comment 1 Elle Stone 2016-10-25 12:29:22 UTC
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.
Comment 2 Michael Natterer 2017-05-16 11:42:43 UTC
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?
Comment 3 Elle Stone 2017-05-16 12:11:55 UTC
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).
Comment 4 BugsBunny 2017-05-16 12:59:38 UTC
> Would we really need both LAB and LCH?

Yes.
Comment 5 Elle Stone 2017-05-16 13:12:03 UTC
(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?
Comment 6 BugsBunny 2017-05-16 13:35:26 UTC
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.
Comment 7 Elle Stone 2017-05-16 14:09:22 UTC
(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.
Comment 8 Elle Stone 2017-05-16 14:51:24 UTC
(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.
Comment 9 Elle Stone 2017-05-16 15:17:51 UTC
(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.
Comment 10 Elle Stone 2017-05-17 10:54:40 UTC
Created attachment 352019 [details] [review]
Add LAB readout to Pointer and Sample Points dialogs
Comment 11 Elle Stone 2017-05-17 11:20:39 UTC
(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.
Comment 12 Michael Natterer 2017-05-17 11:44:24 UTC
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
Comment 13 Elle Stone 2017-05-17 14:28:08 UTC
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
Comment 14 BugsBunny 2017-05-18 20:31:57 UTC
Thank you very much!
Comment 15 Elle Stone 2017-05-19 12:29:21 UTC
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.
Comment 16 Michael Natterer 2017-05-19 13:39:49 UTC
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.
Comment 17 Michael Natterer 2017-06-12 16:30:59 UTC
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.