Layer Mask Basics in Photoshop
Out of the hundreds of features packed into Adobe Photoshop, the most useful feature is the ability to use layers in an image. One key component that makes layers work is the layer mask. This tutorial will show you the basics of photo manipulation using layer masks. I am using Photoshop CS5 for this tutorial, however these techniques will work in any version of Photoshop.
Why use layer masks?
From time to time you will find a situation where you need to combine multiple photos to achieve the desired look or effect to make a photo or graphic design image look it's best. If you want to change the sky in the background of your image or add someone to a photo, you would want to use layer masks. Some people who are just starting out are tempted to use the eraser tool to blend images. The biggest reason to choose layer masks over the eraser brush is because when you make a mistake, a layer mask allows you to correct it. If you're brand new to Photoshop, the concept of combining multiple layers can be confusing, but don't worry. You will end up using layer masks so often that it will become second nature to you very quickly.
Source images
If you want to follow along, start by downloading the full size images linked from the above thumbnails. I picked these images because they will be fairly easy to mask and will provide a good starter example.
Setting up the layers
Start by opening the sunset photo and the downtown photo in Photoshop. Once the files are open, select the move tool (very first icon on the main tool bar) and drag the downtown image onto the background photo. This will automatically create a new layer containing the downtown image on top of our background which is what we're looking for. You might have to drag the top layer around to get it positioned directly over our background. At this point the layers panel should look like the image below.

Creating the layer mask
Now that we have the foreground and background images positioned we will create the layer mask. First select the top layer (Layer 1), then click the "new layer mask" button. This will create the layer mask which we can see to the right of the foreground image (see image below).

How layer masks work
Now that we have created the layer mask, it's time to explain a little about how they work. As you can see, when we first create the mask it is filled with white pixels. In a layer mask, white pixels have no transparency at all, black pixels are completely transparent, and all the shades of gray in between have varying levels of transparency.
Editing the layer mask
To get a feel for how the layer mask works, select a soft round brush at around 50 pixels in size and begin painting away the clouds. Now you see just how powerful layer masks can be. Notice that when you look at the layer mask, the areas you painted in are now showing as black (see first image below). Looking at the layer mask in the layer panel is a good way to keep track of area's you have already masked in a complex image. You're composition should now look like the second image below. You can also make the mask itself viewable by pressing the backslash key (\), this is useful in case you aren't sure that you've covered everything with your mask. You can continue painting away the entire background this way if you want but in this case there is another way we can make things easier.

The layer mask

The composition should look something like this
Using selections to create the layer mask
So far we've been manually painting in the layer mask, but in this case there is a much easier way to mask. Notice that every part of the photo which touches the sky is a straight line. This makes is very easy to create the layer mask using a simple selection. Go ahead and delete the existing layer mask by right clicking the mask in the layers panel and choosing "delete layer mask". Now zoom in to 200% (Ctrl +) and select the polygonal lasso tool from the tool bar (if it's not visible, click and hold the lasso tool and it will pop up). In the tool options up top change the feather radius to 2px. You can start your selection along any of the edges, I chose to start with the top left of the building on the left. Now trace all the building edges with the polygonal lasso until all of the sky is selected. You can now close the selection by clicking on the starting point. You're selection should look like the image below.

Selections continued
Now that we have our selection, go ahead and click the "add layer mask" icon again. Now we can see that the majority of the masking work has been done in one step. There may be areas that need to be cleaned up. Go ahead and paint in any additional areas using a small black brush (be sure you are painting on the mask itself and not the actual image). We now have our final result below.

Conclusion
You may be figuring out by now that there are many ways to create and edit masks beyond what is covered in this tutorial. Any tool that you use to make a selection such as the pen tool, magic wand etc. can be used to initiate a layer mask. You can even apply adjustments such as brightness/contrast to an existing mask to change the way it blends things together. Experiment with a few photos and see what you can learn. I hope you found this tutorial useful and feel free to check out the more advanced tutorials on this site!
Article by Emmett Lollis Jr. November 1st 2010
< back to Photoshop Tutorials
If you like this article feel free to link to it!
![]()



