Using Layer Masks in GIMP to Edit Specific Areas of a Photo

Graphic Designers at Work
Hero Images/Getty Images
of 04

How to Use Layer Masks in GIMP to Edit Specific Areas of a Photo

Layer masks in GIMP offer a flexible to way to edit layers within a GIMP document so that they combine to produce more attractive composite images.

When a layer mask is applied to a layer, the mask makes parts of the layer transparent so that any layers below show through. This can be an effective way to combine two or more photos to produce a final image that combines elements of each of them. However, it can also open up the ability to edit areas of a single image in different ways to produce a final image that looks much more striking than if the same image adjustments had been applied universally to the whole picture.

This is the technique demonstrated in this tutorial using the free image editor GIMP. The technique is well suited for a range of subjects, particularly where the lighting varies significantly across a scene. For example, in landscape photos, you could use this technique to darken a sky at sunset, so that the warm colors don't burn out while lightening the foreground. You could achieve similar results of combined layers by deleting parts of the upper layer rather than using a mask to make areas transparent. However, once part of a layer has been deleted, it cannot be undeleted, but you can edit a layer mask to make transparent area visible again.

You may also find the tutorial on how to convert a digital photo to black and white using the Channel Mixer in GIMP valuable. In that article, I produced one image with a dark sky and one with a light sky, which also resulted in a darker foreground. By using layer masks, these two photos could be combined to produce a final image that has more even contrast and greater detail across the image.

The following pages will demonstrate how to use layer masks in GIMP to combine two different versions of the same image and assumes that you are already familiar with GIMP enough to make the necessary adjustments to create two versions of the image.

of 04

Prepare a GIMP Document

The first step is to prepare a GIMP document that you can then use to edit specific areas of an image. I would advise using a shot of a landscape or similar that has a very obvious horizon line. This will make it easy to edit the top and bottom parts of the image so that you can see how this technique works. When you are comfortable with the concept, you might try applying it to more complex subjects.

Go to File > Open and navigate to your intended digital photo and open it. If you look in the Layers palette, you'll see the newly opened image has a single layer named background. You should now duplicate the background layer so that there are two identical layers in the Layers palette. The Duplicate Layer button is in the bottom bar of the Layers palette, the fourth from the left.

You can now hide the top layer by clicking on the eye icon and use the various image adjustment tools to edit the bottom layer in a way that enhances one specific part of the image, such as the sky. Then you can show the top layer and apply a different adjustment to enhance a different area of the image, such as the foreground.

I'm using two layers that I converted to black and white using the Channel Mixer, with the bottom layer having a dark sky and light foreground. The top layer has a lighter sky with a stronger and more detailed foreground. If you're not too confident with GIMP's adjustment tools, I'd advise you use the Channel Mixer mono conversion technique to prepare a similar GIMP document.

of 04

Apply a Layer Mask

You can now see how to apply a layer mask to the upper layer so that the lower layer is partly visible to produce a more striking combined image. In my GIMP document, I want to hide the sky in the top layer so that the dark sky in the lower layer shows through.

To achieve this I right click on the top layer in the Layers palette and select Add Layer Mask. In the dialog that opens, select White (full opacity). You'll now see that a plain white rectangle appears to the right of the layer thumbnail in the Layers palette. Ensure that the Layer Mask is selected by clicking on the white rectangle icon and then press the D key on your keyboard to reset the foreground and background colors to black and white respectively.

Now click on the Blend Tool in the Tools palette and in the Tool Options below, select FG to BG (RGB) from the Gradient selector. The last step is to place the cursor on the image on the level of the horizon, click and drag upwards to paint a gradient of black on to the Layer Mask. The sky from the lower layer will now be visible with the foreground from the top layer. If the result isn't quite as you'd like, just try applying the gradient again, perhaps starting or finishing at a different point.

In the next step, you'll be able to see the Layer Mask icon and the effect of this step as I show you how you can neaten up the join between the two parts of the image.

of 04

Fine Tune the Join

In this case, the white building in the top layer is a little brighter than the bottom layer, but the mask has obscured it. We can get around this by painting the image mask using white as the foreground color.

To do this, click on the Brush Tool and then in the Tool Options, select a soft brush in the Brush setting and use the Scale slider to adjust the size as required. I would advise reducing the value of the Opacity slider also as this makes it easier to produce more natural results. Before painting onto the layer mask, click the small double-headed​ arrow icon next to the foreground and background colors to make the foreground color white.

Now click on the Layer Mask icon in the Layers palette to ensure that it is selected and you can paint onto the image in the areas where you want to make transparent parts visible again. In my image, this means painting over the building. As you paint, you will see the Layer Mask icon change to reflect the brush strokes that you are applying and you should see the image changing visibly as transparent areas become opaque again.

If you go back to the first page of this piece, you can see the final result of this simple but powerful technique.

mla apa chicago
Your Citation
Pullen, Ian. "Using Layer Masks in GIMP to Edit Specific Areas of a Photo." ThoughtCo, Apr. 24, 2017, Pullen, Ian. (2017, April 24). Using Layer Masks in GIMP to Edit Specific Areas of a Photo. Retrieved from Pullen, Ian. "Using Layer Masks in GIMP to Edit Specific Areas of a Photo." ThoughtCo. (accessed January 20, 2018).