Layer masks make it easy to combine images placed on different layers. Layer mask defines the transparency level of particular areas. At the same time, no change is made to the pixels themselves.
To create a new layer mask, just click Add Layer Mask on Layers palette. A white rectangle will appear next to the layer thumbnail. Layer mask is a grayscale image. What you paint in black will be hidden, what you paint in white will show, and what you paint in gray shades will show in various levels of transparency.
Let's perform a simple collage using layer masks.
A montage will require at least two photos (see pic.1).
Pic.1. Creating collage
Let's replace the face of the first girl with the face of the second girl. The top layer covers the bottom one. As the images are of the same size, only the top layer is visible. To combine the face from the top layer with everything else from the bottom layer, everything but face on the top layer is to be made transparent.
This can be done in several ways. For example, using the Eraser Tool to remove all the areas on the top layer image omitting the face. However, in this case all the pixels will be lost, so if anything goes wrong we'll have to start over. Besides, it will be rather difficult to make the result look good. That is why layer masks are recommended.
A layer mask doesn't remove a single pixel on the layer, it just makes some of them temporary transparent.
Painting in black makes the image transparent while painting in white makes it opaque.The mask can be modified and corrected at any time.
To create mask on the top layer, click Add Layer Mask at the bottom of the Layers palette. The mask is displayed next to the layer thumbnail and automatically linked to it (this is indicated by the link icon) (see pic.2).
Pic.2. Adding a layer mask
By default, the layer mask is painted white, i.e. it is absolutely opaque. Thus, no changes can be seen.
Layer mask is editable when active. The mask sign next to the eye indicates that layer mask is selected for editing.
Brush sign instead of the mask indicates that the layer itself is selected.
You can switch to the layer mask by clicking over it.
Now fill the mask with black to make it completely transparent.Ctrl+Backspace fills the entire layer with the foreground color (in this case the foreground color must be black).
Now use brush to configure the mask. Paint over the area that must be seen. It is the face in this example.
Note: in Photoshop 6.0 the default foreground color for layer masks is white and the background color is black. It was the opposite in versions 5.0 and 5.5. Erasing an area made it opaque. In later versions work with layer masks became more natural.
If the painted area happened to be too large, it is easy to correct with the help of Eraser tool.
See the girl's face change in pic. 3.
Pic.3. Creating collage with the help of layer mask
The following operations will make the whole working process easier:
- to view the content of a layer mask, Alt-click over its thumbnail. To hide the mask, repeat this action;
- to disable layer mast, Shift-click over its thumbnail. Repeated click will enable the mask. (see pic.4);
Pic.4. Disable layer mask
- to create a layer mask, Ctrl-click over the layer thumbnail;
- to load selection, Ctrl-click over the layer mask thumbnail;
- a layer mask is linked to the layer image, however, this link may be easily removed by clicking over the link icon. The layer image unlinked from its mask can be moved independantly as well as the mas itself. Besides that, right click over the layer mask thumbnail brings up a menu containing the following items:
- Set Selection To Layer Mask;
- Add Layer Mask To Selection;
- Subtract Layer Mask From Selection;
- Intersect Layer Mask With Selection;
- Layer Mask Options… calls the dialog to set color and transparency for the layer mask;
- Discard Layer Mask;
- Apply Layer Mask - transparant (i.e. black) areas on the mask are deleted;
- Disable Layer Mask.
Layer mask helps to blend images using Gradient tool. For example, there are two photos of a forest road. One of them shows autumn, the other one displays summer. With Photoshop it is easy to blend them.
First of all, use clipboard to copy each image to a separate layer. Then click
Add Layer Mask on the
Layers palette to create a mask on the top layer. Staying on the mask, press
G to select
Gradient tool (

in the toolbox). Make sure it is a linear black to white gradient.
Now hold the Shift key to draw an ideally straight vertical line starting from about one third of the image from below (see pic.5).
Рис.5. Create gradient on layer mask
Note: A layer mask is only able to display shades of gray. When a colored gradient is used, the mask itself will still show a black to white gradient.
Any drawing tools, filters, ans selections can be applied on a layer mask. You can work with the mask as with regular grayscale image, and create masks of any complexity.
Layer masks also allow such a wide-spread effect as type filled with an image. Create a new empty document with clear white background and then copy a picture to a new layer. Select the Horizontal Type Mask Tool in the toolbox. Now type the desired text and click Add layer mask at the bottom of the Layers palette. Type will be filled with the image. (see pic.6).
Pic.6. Using layer mask to fill text with image