How to Use Layer Masks in GIMP

Editing Specific Areas of a Landscape Photo

Graphic Designers at Work
Hero Images/Getty Images

Layer masks in GIMP (GNU Image Manipulation Program) provide a flexible to way to edit layers that combine within a document to produce more attractive composite images.

The Advantages of Masks and How They Work

When a 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. 

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.

Using Layer Masks in GIMP

The technique demonstrated in this tutorial uses the free GIMP image editor and is well suited for a range of subjects, particularly where the lighting varies significantly across a scene. It shows how to use layer masks in a landscape image to combine two different versions of the same image. 

of 03

Prepare a GIMP Document

The first step is to prepare a GIMP document that you can use to edit specific areas of an image.

Using a photo of a landscape or similar that has a very obvious horizon line will make it easy to edit the top and bottom portions 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.

  1. Go to File > Open to open the digital photo you want to work with. In Layers palette, the newly opened image appears as a single layer named background.
  2. Next, click the Duplicate Layer button in the bottom bar of the Layers palette. This duplicates the background layer to work with.
  3. Click the Hide button (it appears as an eye icon) on the top layer. 
  4. Use the image adjustment tools to edit the visible bottom layer in a way that enhances one specific part of the image, such as the sky.
  5. Unhide the top layer and enhance a different area of the image, such as the foreground.

If you're not too confident with GIMP's adjustment tools, use the Channel Mixer mono conversion technique to prepare a similar GIMP document.

of 03

Apply a Layer Mask

We want to hide the sky in the top layer so that the dark sky in the lower layer shows through.

  1. Right click on the top layer in the Layers palette and select Add Layer Mask.
  2. 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.
  3. Select the Layer Mask by clicking on the white rectangle icon and then press the D key to reset the foreground and background colors to black and white respectively.
  5. In the Tools palette, click the Blend Tool.
  6. In the Tool Options, select FG to BG (RGB) from the Gradient selector.
  7. Move the pointer to the image and place it 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, try applying the gradient again, perhaps starting or finishing at a different point.

of 03

Fine Tune the Join

It may be the case that the top layer is a little brighter than the bottom layer, but the mask has obscured it. This can be adjusted by painting the image mask using white as the foreground color.

Click the Brush Tool, and in the Tool Options, select a soft brush in the Brush setting. Use the Scale slider to adjust the size as required. Try 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.

Click the Layer Mask icon in the Layers palette to ensure that it is selected and that you can paint onto the image in the areas where you want to make transparent parts visible again. 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.

mla apa chicago
Your Citation
Pullen, Ian. "How to Use Layer Masks in GIMP." ThoughtCo, Feb. 26, 2018, Pullen, Ian. (2018, February 26). How to Use Layer Masks in GIMP. Retrieved from Pullen, Ian. "How to Use Layer Masks in GIMP." ThoughtCo. (accessed March 19, 2018).