Using a Basic Mask

On this page I work through how to use a threshold layer to create a basic mask that can then be used to selectively apply optimization tools to different parts of the image. We will not consider any other aspects such as composition.

The Original Image

As usual, this is a size reduced copy the original image, from the camera. It was taken in natural light. As is clear in the image, the day was dull and overcast.

My goal here is to make the image moodier and more striking by emphasizing the contrast in the sky and brightening the stone work of the chapel walls.

First take a look at the histogram for the image in its original state:

HistogramThere is a very broad spread of luminance here, so making a global adjustment to the levels is unlikely to make much difference to the appearance. This is why we need to work on the two regions separately.

Making the Mask

To be able to apply different effects to the different regions of the image it is first necessary to create a mask. Because the image itself has a fairly clear boundary between the chapel and the sky, we can use a simple threshold filter to create the mask.

Threshold DialogWe will create a new adjustment layer to apply a Threshold to the original image. This can be found on the menu:

Layer>New Adjustment Layer>Threshold...

This displays the histogram of the underlying image and allows you to set a threshold. Everywhere in the image that the luminance is below the threshold will be rendered black, and everywhere in the image where the luminance is above the threshold will be rendered white.

Mask LayerBy selecting the threshold point carefully we can ensure that all of the sky remains white whilst the chapel walls become black. This results in the image shown on the right.

We can now use the threshold as the basis of a selection and because this threshold is on a separate layer we have not affected the underlying image.

Make sure the threshold layer is selected in the layer palette and then use the magic wand to select the sky region in that layer. Now turn the visibility of the threshold layer off in the layer palette. Notice that the sky region is still selected, but now in the base layer. Select the base layer in the layer palette.

Adjusting the Sky

Now we have the sky selected we can create a new adjustment layer that will only affect that region of the image. Select the following menu item:

Layer>New Adjustment Layer>Levels...

This will create a new layer with a level adjustment tool. However, the levels are only being applied to the selected region of the image. Because of this the histogram will only show the information for the relevant region of the image, as shown on the left below. The resulting image is shown on the right below.

Histogram of the sky region Sky fixed

Notice how much more striking and moody the sky has become when compared to the original image.

Adjusting the Chapel Stonework

We now wish to apply the same technique to adjust the appearance of the chapel stonework. Turn the visibility of the threshold layer back on and again use the magic wand tool to select the sky region. Then use the Select>Inverse command to reverse the selection so that everything other than the sky is selected. Turn the visibility of the threshold layer off again and reselect the base layer in the layer palette. Once again, create a new adjustment layer for levels. Now we are only adjusting the levels for the chapel stonework. The histogram is shown below left, and the final image, with both regions adjusted is shown below right.

Histogram of the chapel region Final Image

This creates a much more dramatic final image that has a dark moody sky, but with a clearer, more dynamic appearance in the stone work and window carving.

Layers DialogThe image on the left shows the final layer palette, with the base layer and the two adjustment layers visible and the threshold layer invisible. As well as exporting a version of the image for its target use, I would also save this as a PSD document so I can always go back and make any further alterations to the image if necessary.

Note that in this example, the threshold mask was easy to use because there was such a sharp difference between the sky and chapel, but in most cases it will be difficult to get such a sharp division in the threshold layer. In such cases it is possible to use a brush in each of the adjustment layers to modify the exact region being used as the layer mask. Alternatively, you could use a different selection method such as the magnetic lasso.

Back back to the list of examples.