Layer masks are used to block out parts of a layer, without permanently removing those parts from the photo. It is called "non destructive" masking. Open a file of your choice, I opened a picture of an eagle.
If I want to get rid of the background and keep only the eagle, I can use a layer mask. Background layers do not allow transparency, so the first thing to do is double click on the background layer and rename it. The default Layer 0 is OK. The important thing here is that it is converted from a background layer to a regular layer that allows transparency. To add a layer mask, click on the Add Layer Mask button at the bottom of the layers panel.
A white box is added next to the thumbnail image on your layer. This represents your mask. You can select the thumbnail or the mask by clicking on each one with the mouse. Make sure the layer mask is selected while you create or modify your mask. When the mask is selected there is an outline around the mask.
The mask uses black and white and shades of gray. The areas you want to block out will be black. The white areas of the mask will allow the picture to show through. Anything gray will be partially hidden in proportion to the shade of gray used. You can apply black to the mask in a number of different ways. You can use the brush tool to paint on the mask, or make a selection and fill it with black. Lets try the brush tool first.
Select the brush tool from the tool pallet. In the options bar open the brushes pallet and select a hard edged brush. Select a small size for intricate detail, or a larger one to cover larger areas. Choose black as the foreground color. You can change sizes of the brush as you paint to be able to get into small areas, or cover large areas.
Begin painting on the mask in the areas you want to hide. Here I'm carefully going around the eagle with a small brush.
You can see how painting with black is adding black on the layer mask thumbnail, and masking out the background of the photo. Just as painting with black will mask the photo, painting with white will delete parts of the mask, letting the photo show through. You can switch back and forth between black and white as you go around the subject to refine the edge of the mask. Just use the "X" key to switch between black and white. It will be easier to follow the edge of the subject if you enlarge the view of the image. You can use Control+ (plus sign) (Command + on a Mac) to enlarge the view, and Control - (minus sign) (Command - on the Mac) to shrink the view. While the view is enlarged, you can hold down the spacebar to temporarily get the hand tool so you can move the image around if needed. You can continue painting around the subject, switching between white and black, big brushes or smaller brushes until the mask is perfected.
Another way to apply black to the mask is to make a selection of the subject, in this case the eagle (see the tutorial on selections to find different ways to make the selection). If there is good contrast between the subject and the background, you can use the quick selection tool. Since we want to fill the mask area with black, you can either select the subject and invert the selection, or select the background, whichever is easier. I selected the eagle, then inverted the selection by typing "Control + I" (letter i) (Command I on the Mac). Now everything except the eagle is selected. Once you have the background selected, and the layer mask selected, and black as the foreground color type Alt delete (Option delete on the Mac) to fill the selection with the foreground color (black). Now you can use the brush tool to fine tune the mask if needed.
You can modify the mask, add to it or subtract from it. You can use filters on it, paint with a soft edged brush, blur it, use a gradient, etc. It is usually a good idea to blur the mask slightly. A hard edge makes the image look "cut out" where a slight blur makes it blend in with the new background you will be using. Be careful not to blur it too much. Next I'm going to paint with white to bring back some of the log the eagle is sitting on.
You can check your mask by creating a new layer, filling it with a contrasting color, and dragging it below your layer with the layer mask. You will be able to see where you need to adjust the layer mask. Here I filled a layer with red. See the black halo around the white head of the eagle? I still need to work on the mask a little before it is finished. Continue painting with black and white to refine the mask until it looks natural against the red background.
Sometimes you need a selection of the mask. If you want to turn your mask into a selection, just Control Click (Command Click on the Mac) on the mask thumbnail. To see the mask alone Alt Click (Option Click on the Mac) the mask thumbnail. This is useful when painting with a brush. Many times small slivers remain unpainted. It is easy to see these missed areas if you view the mask this way.
To hide the mask, just Shift Click on the mask thumbnail. A red X shows on the layer mask thumbnail indicating the the visibility is turned off. To apply the mask again, click on the mask.
If you decide you don't want the mask you can drag it to the trash can at the bottom of the layers panel. If you do, you get the warning box shown here. If you apply the mask it becomes a permanent part of the layer, kind of defeating the idea of "non destructive" masking.
Image masks are a great way to modify images. You can combine two or more images together without permanently deleting anything in either picture. Experiment on your own, with your own images. Make photo collages or silhouettes for your scrapbook pages.
"That which we persist in doing becomes easier for us to do; not that the nature of the thing itself is changed but that our power to do is increased".