This document presents the Layer Mask of Photoshop: its principle, its use with the Gradient Tool and the Brush Tool, then the stacking of several layer masks with layer groups.
A layer mask hides or reveals areas of a layer, which lets the layer below show through. It works like a stencil that you edit with the Brush Tool or the Gradient Tool.
A layer mask contains only white, black and shades of gray: white displays the pixels of the layer, black hides them, and a gray gradient makes the layer below appear gradually.
A layer mask is non-destructive: the image of the layer it is applied to stays intact.
Catalog reference: Photoshop Tutorial_0014.
Identify the level of each chapter
🟢 All levels
- Core concepts to master.
- Recommended for all users.
🟡 Intermediate level
- Requires mastery of the core concepts.
- Commonly used techniques.
🔴 Expert level
- Advanced techniques.
- Used in specific or professional cases.
🟢 Apply a gradient to a layer mask
For all Photoshop projects, it is recommended to always create a copy of the base Background layer and hide the original layer. This method preserves the original image: if you are not satisfied, delete the copy and create a new one.
Duplicate the Background layer [Windows shortcut: Ctrl + J] [Mac shortcut: Cmd + J], then hide the original layer by clicking the eye icon to its left.
Create a new empty layer by clicking the Create a new layer icon (marker 1) at the bottom of the Layers panel. Check that this layer is visible with the eye icon next to the layer (marker 2). Drag it below the copy of the base layer.

Select the Eyedropper Tool (marker 1) [Windows shortcut: I] [Mac shortcut: I], then sample the green of the car body by clicking the body. In this example, click the location of marker 2. The sampled color immediately becomes the foreground color and appears in the color squares at the bottom of the toolbar.

Select the Layer 1 layer (marker 1) and hide the Background copy layer (marker 2). Select the Paint Bucket Tool (marker 3), choose the green color (marker 4), then click in the image to fill the whole Layer 1 layer with green.

Display the Background copy layer again by clicking the eye icon.

Select the Background copy layer (marker 1), then click the Add Layer Mask icon (marker 2) at the bottom of the Layers panel.

In the toolbar, click the small arrow at the bottom right of the Paint Bucket Tool, then select the Gradient Tool.

A layer mask works only with white, black or gray pixels. To obtain a gradient from black to white, click the Default Foreground and Background Colors icon (marker 1) [Windows shortcut: D] [Mac shortcut: D]. Check that the black and white gradient is displayed in the gradient preview of the options bar (marker 2), then select the Linear Gradient mode (marker 3).

Click the thumbnail of the layer mask to select it.
![]()
Check that the layer mask is selected: a frame appears around its thumbnail.

Click at the bottom of the image, at the location of the blue dot, then hold down the mouse button and move up toward the center of the image, to the tip of the orange arrow. Then release the mouse button.

The gradient is applied to the layer mask: the green Layer 1 layer, located just below in the layer order, appears gradually.

To better understand how the layer mask works, hide the Layer 1 layer (marker 1). The transparency of the gradient applied to the mask becomes visible (marker 2).

To check that the layer mask is non-destructive, right-click its thumbnail, then choose Disable Layer Mask. The mask is temporarily inactive and the original image is not affected by the changes made on the mask.

To continue exploring the layer mask, select the Brush Tool [Windows shortcut: B] [Mac shortcut: B] and the black color, to remove pixels on the layer mask.

Apply the brush to the top of the image. In the illustration below, the pixels are removed from the layer mask, which acts as a stencil, and reveal the green pixels of the Layer 1 layer located directly below.

Then select the Brush Tool with the white color to restore the pixels and “fill in the holes”.

In the lower part of the illustration below, using white with the brush on the layer mask restores the original pixels of the layer.
![]()
The changes made on the layer mask appear on the thumbnail of the mask.
![]()
🟢 Use the brush on a layer mask
The exercise consists in keeping the sandy beach of the image on the left and adding to it the purple sky and sea of the image on the right.

To start, duplicate the base layer to make a copy that serves as the working base for editing the images: right-click the thumbnail of the Background layer, then choose Duplicate Layer….

Import the second image into Photoshop by dragging and dropping it.

Press the Enter key: the imported image is converted into a Smart Object. This type of layer lets you resize the image without degrading its pixels. The symbol at the bottom right of the layer thumbnail shows that it is a smart object.
![]()
Resize the image placed at the top of the layer stack with the Free Transform command [Windows shortcut: Ctrl + T] [Mac shortcut: Cmd + T], so that it covers the image placed below.

Decrease the Opacity value of the layer placed at the top of the stack so that the image below begins to show through.

Select the Move Tool (marker 1) [Windows shortcut: V] [Mac shortcut: V], then move the image with the arrow keys of the keyboard so that the two horizons (markers 2 and 3) overlap.


In the illustration below, the two horizons overlap.

Set the Opacity value of the purple layer back to 100% to make it fully opaque.

In the Layers panel, swap the order of the layers by dragging and dropping, as shown below.

Select the top layer, then click the Add Layer Mask icon.

Select the layer mask that was just created.

Select the Brush Tool.

In the tool settings, choose a brush size suited to the size of the image and a suitable hardness. In this example, enter 500 px in the Size field and 54% in the Hardness field.

Select the white color.

Start applying the brush on the layer mask.

The photo placed on the lower layer begins to appear.

In the illustration below, the final result shows that the beach of the photo placed on the upper layer is kept, while the sky and the sea of the photo placed on the lower layer appear thanks to the layer mask.

🟡 Stack layer masks
This chapter builds on the example of the first chapter, in which the Gradient Tool is used on the layer mask to reveal the green layer placed just below. It presents the method to apply the same treatment to the four sides of the image, to illustrate the technique of stacking layer masks.
In the illustration below, a gradient is already applied to the lower part of the image through the layer mask.

Select the Background copy layer, then click the Create a new group icon at the bottom of the Layers panel.

Drag the Background copy layer into Group 1.

In the illustration below, the thumbnail of the Background copy layer shifts to the right when it is placed in Group 1.

Select Group 1 (marker 1), then click the Add Layer Mask icon (marker 2) to create a layer mask.

A layer mask is created at the level of Group 1. Select it: a frame appears around its thumbnail when it is selected.

Select the Gradient Tool in the toolbar, with the same settings as in the first chapter (black and white gradient, Linear Gradient mode).

Apply a gradient from top to bottom on the upper part of the image, through the layer mask of Group 1.

Click the Create a new group icon again. Photoshop automatically names this new group Group 2.

Drag Group 1 into Group 2. In the illustration below, the thumbnail of Group 1, which contains the Background copy layer, shifts to the right in the Layers panel.

Select Group 2, then create a layer mask as for Group 1.

Apply a gradient from left to right on the left part of the image, through the layer mask of Group 2.

Click the Create a new group icon again. Photoshop automatically names this new group Group 3.

Drag Group 2 into Group 3.

Select Group 3, then create a layer mask as for Group 1.

Apply a gradient from right to left on the right part of the image, through the layer mask of Group 3.

In the illustration below, the layers and groups are organized this way at the end of the project.

