Illuminating Luminosity Masks (Author: Eric Tatham)
As an example, here’s an image in which I want to lighten the foreground to bring out some shadow detail but do not want to blow out the highlights in the sun and sky. (See Fig 1)
(Fig 1 – The original image)
I could use the Burn Tool in Photoshop but I would have to be quite careful to only brush over the regions I want to affect.
In this particular image there is quite straightforward separation between the darker foreground and the lighter background so I could simply select the foreground and create a mask to protect the background.
Masking images according to lightness and darkness is known as luminance or luminosity masking.
For our purposes we can think of luminance as being equivalent to brightness. If you convert any colour image to black and white the resulting greys represent luminance values; the lighter areas having a higher luminance values. (See Fig 2)
(Fig 2 – Original image converted to Black and White to show luminance levels)
The separation between light and dark areas of an image may not be as clear-cut as in our sample photograph and such a mask would be hard to produce by hand. Fortunately we can use Photoshop to help us create a much more accurate mask.
Here’s how.
Use Cmd-J on a Mac (or Ctrl-J in Windows) to create a copy of your image.
(Fig 3 – Copy layer)
Switch from the Layers Panel to the Channels.
Hold the cursor over the RGB Channel and left-click whilst holding down the Cmd key on a Mac (Ctrl key in Windows).
Marching ants should appear on your image showing the regions selected. This region will include all pixels that have a luminance value of greater than 50%. (See Fig 4)
(Fig 4 – Highlight selection)
Go back to the Layers panel and select your image layer. Right-click on the Create New Fill or Adjustment Layer icon and select Curves from the drop-down list. (See Figs 5 and 6)
(Fig 5 – Create new adjustment layer)
(Fig 6 – Create new Curves adjustment layer)
This will create a Curves Adjustment Layer with a mask that protects the pixels that have a luminance level darker than 50%. (See Fig 7)
(Fig 7 – Luminosity mask for highlights)
The mask effectively divides the image into two regions. One containing all pixels with less than 50% luminance and the other with 50% luminance or more.
Remember the Black areas of the mask protect the underlying image layers and White areas are transparent.
You can view the mask by selecting it in the Layers panel then clicking whilst holding down the Alt key on a Mac (or the Option key with Windows). (See Fig 8)
(Fig 8 – Luminosity mask for highlights)
Once again, click with Alt or Option held down to change back to the main image.
Now if we manipulate our adjustment Curve only the lighter areas of the image are affected. (See Fig 9)
(Fig 9 – Curve adjustment for highlights)
For this particular image it was actually the darker areas that we wanted to adjust so to do this we need to Invert the mask.
We can quickly invert by selecting the mask in the Layers panel then pressing Cmd-i on a Mac (or Ctrl-i with Windows).
The mask now protects the lightest parts of the image and allows us to adjust the Curve for the dark areas. (See Figs 10, 11 and 12)
(Fig 10 – Luminosity mask for shadows)
(Fig 11 – Luminosity mask for shadows)
(Fig 12 – Curve adjustment affecting only the shadows)
It is possible to take the highlight and shadow masks we have produced and from them create additional masks that further sub-divide the highlight regions and the shadows. In this way we can create a whole stack of luminosity masks that will allow us to selectively adjust more refined ranges of luminance.