Manually set luminance channel values?

Luminosity masks: The range of tones chosen in the typical GIMP setup (Saul Goode or Pat David script) sometimes seems arbitrary. What if I have an area with distinct lightness/darkness but is getting included with nearby values in the scripted channels? Is there a way to measure the area’s high and low tone values and create a channel with those numbers manually entered? I had no luck Googling this.

Is you question specific to GIMP, or more general?

I’m asking because PhotoFlow gives the possibility to generate luminosity masks by simply converting any channel to luminance, and then applying a curve to tweak the mask such that it covers only a specific luminance range.

Specific to GIMP, please.

In the tutorial on @patdavid’s site, he goes over making six channels for masking. I’m not sure what the script does, but you should check the blog post.

http://blog.patdavid.net/2013/11/getting-around-in-gimp-luminosity-masks.html?m=1

That’s where I started. The script apparently saves the user some of the tedium of manually setting up “light” and “dark” channels. It also takes the fine control out of my hands.

You should be able to load the channel as a layer, then apply a curve or levels to it to modify the range. Then copy it back to the channel.

OK I will experiment and report back.

Look at G’mic/Lights&Shadows/Slice luminosity

1 Like

The script (mine and saulgoode) follows the same principles that Tony Kuyper originally described. That is, a basic lowest-level mask that all the others are built from starts with a direct luminosity desaturation of the layer.

Now, what Tony does is he creates the base Darks mask by inverting this same layer. Subsequently thresholding each at 50% values and then shifting the range results in the lighter versions and the darker versions. Subtracting each from the other will create the mid-tone masks.

Now if you want to include a specific region, you are likely looking for what’s often referred to as a bandpass filter. So, let’s say we want to have a mask that allows a specific level of mid-tones in my image:

So perhaps you want to target the tones of the sidewalk. To find what types of valus are there it may help to first copy this layer, then desaturate (luminosity is usually fine).

In GIMP, invoke the “Curves” dialog. Then you can click+hover your mouse over the actual image in the areas of interest to see where they fall on the curves.

Once you know roughly where you want to isolate with this mask, modify the curve such that there’s a peak around the values you want to isolate, and the it cuts off values outside of that range (to taste, of course).

You’ll probably want to fiddle with the curve shape in order to feather it as desired, and also watch out for tones that you might not have been paying attention to that technically still fall inside the range you’re interested in! :slight_smile:

1 Like

Wow; very detailed replies! I now have no excuse not to create an amazing image :slight_smile:

I’m attempting this on an image where I’m trying to isolate several areas and give ea a separate treatment. The problem is that I can’t see quite what my final result will look like. The multiple masks are apparently competing with each other. Am I right in thinking I need to first complete an area, flatten that and then continue? One mask/area at a time?

Load the mask as a selection, then switch masks, then delete the selection from the second mask.

I’ve been selecting each mask by turning on the visibility for that masked layer; is that what you mean? Here is a screen capture…
screen capture

I’m on my phone, but will revisit this tomorrow in further detail to help out hopefully. (Assuming someone else doesn’t jump in before then :smile:)

Not quite.

If you didn’t want “mid yellow” and “near yellow” to overlap each other, you can remove all the over-lapped, masked parts from “mid yellow” by doing this:

  1. Right click the mask for “near yellow” and select Mask to selection.
  2. Right click the mask “mid yellow” and select Edit layer mask.
    You should still have the selection you made from step 1 active.
  3. Press the Delete key.
    The masks shouldn’t overlap any more. Press the delete key again to remove more of the mask.

You should probably try this on a copy of your XCF file so you don’t ruin your masks testing this out.

What I’ll usually do is copy the base layer and apply the layer mask to it. Then I can make modifications to the entire layer, but keep it isolated to a region by the mask itself.

Since these are usually self-feathering if created using one of the scripts, i’ll normally have darkest layers at the bottom, and work up to lightest layers at the top.

So if I wante to add cyan to the darker tones, and orange to the lightest tones, I would do something like this (exaggerated of course):

I will start using these tips pronto. Thank you both!

I got a chance to try this several times tonight with a copy of the xcf. The instant I press the Delete key, all content in the layer mask being edited disappears. I tried re-creating the Mask-to-Selection mask and doing the subsequent steps again. Same total loss of the target layer mask content. Looking at the checkerboard. (I’ll be back in front of the PC Thursday.)

It sounds like you somehow have the whole layer selected, not just the mask.