RSS/Atom feed Twitter
Site is read-only, email is disabled

Color spaces and layer blend modes - tool layers

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Color spaces and layer blend modes - tool layers Christopher Curtis 01 Aug 17:57
  Color spaces and layer blend modes - tool layers Bill Skaggs 01 Aug 19:04
   Color spaces and layer blend modes - tool layers Christopher Curtis 01 Aug 20:02
  Color spaces and layer blend modes - tool layers Charlie De 02 Aug 00:36
Christopher Curtis
2010-08-01 17:57:44 UTC (over 14 years ago)

Color spaces and layer blend modes - tool layers

Hello,

Let me start by saying I haven't been following any development builds of GIMP or GEGL, so I may have some false presumptions and I certainly lack some information. That aside, I'd like to ask some broader questions about color spaces.

Firstly, some background: the HSY color space appears to be much better than HSL, at least for some color operations. The package "PhotoPNMTools" operate in HSY mode and produce very nice output on their page of sample images. I'm not sure how the operation "Increase saturation 4x" is performed in GIMP, but when I use the Hue-Saturation tool and set Saturation to "100" four times the result is far worse than what is displayed on the sample images page (using GIMP 2.6.8).

[ PhotoPNMTools: http://www.13thmonkey.org/~boris/photopnmtools/ ] [ Sample Images:
http://www.13thmonkey.org/~boris/photopnmtools/saturation-test.html ]

Using the PhotoPNMTools and the flower image, I've set the saturation to 4000 (on a scale of 0..1) and it still looks better than GIMP's output. I've also set the saturation to '2' four times in series. There is a difference between these two images (the saturation at 2 four times and at 4000) but the distorted parts of the image remain fairly consistent, so the algorithm appears to produce very stable results.

Next, Windows Vista uses something called the Windows Color System, which uses CIECAM02 LMS space, ratified in 2008. I don't see any tools that work in this space for comparison with HSY, but it seems to be clear that there are a lot of different models of how colors can be displayed and manipulated.

[ http://en.wikipedia.org/wiki/CIECAM02 ]

My observations, now, are that the layer blend modes chose a color space based on some semi-abritrary criteria, and that this information isn't immediately obvious to the end user. Secondly, tools such as Hue-Saturation are fixed to the HLS color model.

My thoughts are that this is too limiting, and I'd like to know what you think about the following:

#1: Add additional color spaces to the color manipulation tools (HSV/HSL/HSY/RGB/Lab/LMS/CMYK/etc/etc), where appropriate.

#2: Allow a tool configuration layer to appear as a node in a GEGL graph.

#3: Remove the concept of explicit layer blend modes.

So what we end up with is something like the following:

- Image01 - + Layer Group 1
- - Layer Group 2
- - - Top Image
- - : Saturation Tool in HSY-space @40% - - - Bottom Image
- + Layer Group 3
... etc.

This is probably a very poor example and I'm sure I'm abusing some terminology, but I hope you get the gist of what I'm saying. "Layer Group 2" is an image-tool-image sandwich, which in current GIMP would be two images with a layer blend mode of "Saturation". But this way, instead of a fixed mode, we have something far more configurable. Unlike a layer mode it's not a fixed thing, so it should also be relatively future-proof as new modes or color spaces simply become new options for this tool layer.

I expect some people will want to know what this "tool layer" looks like, and I'm thinking it would be something like a simple gray mask, but I'm more interested what people think about the concept at this time.

Chris

Bill Skaggs
2010-08-01 19:04:20 UTC (over 14 years ago)

Color spaces and layer blend modes - tool layers

It would be much better not to use the word "tool"in this way. In Gimp, a tool
is an element of the user interface. When the user applies a tool, the end result is to perform a series of operations on the image. Thus, a tool is a user interface element that allows the user to interactively specify a series
of operations. What you are talking about storing as part of the image are color operation layers, not tool layers.

The flip side is that the way a tool works can be changed without violating backward compatibility. If you can find a way to make the Hue/Saturation tool
work better, there's no strong reason it couldn't be put into Gimp. Changing
layer modes that are stored in XCF files is more problematic.

-- Bill

Christopher Curtis
2010-08-01 20:02:20 UTC (over 14 years ago)

Color spaces and layer blend modes - tool layers

On Sun, Aug 1, 2010 at 1:04 PM, Bill Skaggs wrote:

It would be much better not to use the word "tool"in this way.

I agree terminology is going to be difficult. I get the impression you are only thinking about color, but I'm not. Maybe it's clearer if I use the terms "Image layer" and "Blend layer".

So our layer tree has an image on the bottom and an image on the top. Where the top image has alpha, the bottom image can been seen through, as it is today.

Now, instead of making the layer mode "Multiply" (or 'screen' or 'saturation' or 'lighten' (which have the same issues as color), etc), the user inserts a "Blend Layer" between the images. This "Blend Layer" is a "Multiply" type, and the "Multiply Blend Layer" has properties associated with it. One of these is "Color Space".

Further, this "Blend Layer" has a gray(/alpha) mask so that the layer effect may apply to only a portion of the image. Further still, multiple "Blend Layers" may reside between the two images.

So for example, picture a bottom layer of a frog sitting on a log. Above that is a "Desaturation Blend Layer" in the HSY color space, making it appear black and white. Above that is "Lighten Blend Layer" that is a graymask of the frog, making only the frog appear slightly puched-out. Above that is a color image layer of a butterfly (or something) near the frog.

Your graph now resembles: - [Image]: Butterfly
- [Blend]: Lighten (Lab), Frog mask
- [Blend]: Desaturate (HSY)
- [Image]: Frog on a log

I'm thinking that some color tools could become unnecessary if you do this (just create a blend layer and flatten the image...), but I'm not advocating their removal.

I'm also thinking that 'layer modes' could be useful when you have multiple blend layers, but they wouldn't be as problematic as they are all gray masks (add, subtract, etc. are all well-defined.)

backward compatibility.  If you can find a way to make the Hue/Saturation tool work better, there's no strong reason it couldn't be put into Gimp. Changing layer modes that are stored in XCF files is more problematic.

I'm not sure where this is coming from, but so it's clear: I think that Hue/Saturation is essentially unfixable. If you want to work in L*a*b space, such ideas don't exist. You would either need a color space selector and a complicated tool, or a tool for each colorspace type. And layer modes go away altogether.

Instead you get a "Blend Layer" that performs the operations of the tool, using the color space specified in the properties of this "Blend Layer". And instead of constraining your image using a selection, the "Blend Layer" retains a gray mask indicating the affected pixels. The gray, in this case, replacing (or augmenting) an opacity slider.

Chris

Charlie De
2010-08-02 00:36:01 UTC (over 14 years ago)

Color spaces and layer blend modes - tool layers

#1: Add additional color spaces to the color manipulation tools (HSV/HSL/HSY/RGB/Lab/LMS/CMYK/etc/etc), where appropriate.

If by this you mean that one could choose the colour space and the individual channels in which the command or tool is applied, then this is an excellent idea. It would help speed up the image processing workflow, allow for tools to be used with more precision, and in many cases obviate the need for using layers to accomplish processing tasks.

Charlie