Understanding Layer Masks In Photoshop

Written by Steve Patterson. In this Photoshop tutorial, were going to look at one of the most essential features in all of Photoshop layer masks. Well cover exactly what layer masks are, how they work, and why you want to use them. If youve been staying away from using layer masks with your Photoshop work because you thought they were somehow beyond your skill level, well, if you know the difference between black and white and can paint with Photoshops Brush Tool, you already have all the skills you need!

A wise man once said, Nothing worth doing in life should be done without layer masks. Apparently, the wise man was a big Photoshop user who may have spent a little too much time alone on top of the mountain. But enough about him. Layer masks are right up there at the top of the list of things you really need to know about when working in Photoshop because without them, your work, your creativity and your flexibility all suffer. Its that simple. Its a good thing for us, then, that layer masks are so incredibly simple and easy to understand!

Before we continue, if youre unsure of what a layer is, you may want to read our tutorial on Photoshop layers before learning about layer masks.

So what are layer masks then? Well, if the term "mask" is whats confusing you (and who could blame you), replace the word "mask" in your mind with "transparency", because thats exactly what a layer mask does. It allows you to control a layers level of transparency. Thats it, thats all. Theres nothing more to them than that. Now, you may be thinking, "But I can already control the transparency level with the Opacity option, cant I?", and yes, you certainly can. The Opacity option in the top right corner of the Layers palette also allows you to control a layers transparency.

But heres the difference. The Opacity option changes the transparency level for the entire layer at once. If you lower the Opacity level down to, say, 50%, the entire layer becomes 50% transparent. That may be fine for some situations, but what if you want only part of a layer to be transparent? What if you want the left side of the layer to be completely transparent, the right side to be completely visible, with a gradual transition between the two through the middle of the layer? Thats actually a very common thing to do with a layer in Photoshop, allowing you to fade from one image to another. But you cant do that with the Opacity option since as I said, its limited to controlling the transparency of the entire layer at once. What you would need is some way to control the transparency of different areas of the layer separately. What you would need is a layer mask.

Lets look at an example. Here I have a couple of wedding photos that I think would work well blended together. Heres the first one:

The first wedding photo.

And heres the second one:

The second wedding photo.

In order to blend them together, whether Ill be using a layer mask or not, I need to have both photos inside the same Photoshop document, so with each photo open in its own separate document window, Im simply going to press V on my keyboard to select my Move Tool and then click inside one of the documents and drag that photo into the document containing the other photo:

Dragging one photo into the same Photoshop document as the other photo with the Move Tool.

Now both photos are in the same Photoshop document, and if we look in the Layers palette, we can see that each one is on its own separate layer, with the photo of the couple facing towards the camera on top and the photo of the couple walking away from us into the woods below it:

Photoshops Layers palette showing each photo on its own separate layer.

So far, so good. Now, how am I going to blend these two photos together? Well, lets see what happens if I simply try lowering the opacity of the top layer. Im going to lower it to about 70% just to see what sort of effect I end up with:

Lowering the opacity of the top layer to blend it with the layer below it.

Heres my result:

The image on the bottom is now showing through the image on the top layer.

Hmm. After lowering the opacity of the top layer (which again contains the image of the couple facing towards the camera on the right), the image on the bottom layer of the couple walking in the woods is now showing through the image above it. This effect may work if I was trying to turn the wedding couple into a couple of ghosts, but its not really what I was hoping for, so Im going to raise the opacity of the top layer back to 100% to make the top image fully visible once again. Lets try something else.

So far in our quest to blend our two photos together, weve tried lowering the opacity of the top layer with disappointing results, since all that basically did was fade the entire image. What I really want is for the couple in both images to remain fully visible, with the blending of the two images happening in the area between the bride walking away from us on the left and her looking towards us on the right. I know, why dont I just use Photoshops Eraser Tool! Thats what Ill do. Ill use the Eraser Tool with nice, soft edges to erase the part of the image on the right that I dont need. Yep, this should work.

Ill press E on my keyboard to quickly select the Eraser Tool. As I said, I want soft edges for my Eraser, so Im going to hold down my Shift key and press the left bracket key a few times, which softens the edges. I can also increase or decrease the size of the Eraser as needed using the left bracket key on its own to make the Eraser smaller and the right bracket key to make it larger (the same keyboard shortcut works with any of Photoshops brush tools). And now that I have my Eraser at the right size and with soft edges, Ill go ahead and erase away parts of the left side of the top image so that it blends in with the image below it:

Erasing parts of the left side of the top image so it blends seamlessly with the image below it.

After finishing up with my Eraser, heres my result:

After erasing away part of the top image, both images now seem to blend together well.

Things definitely look much better now than they did when we tried lowering the opacity of the top layer. The couple is still visible in both images with a nice transition area in the middle, which is what I wanted. The Eraser Tool worked great! Who needs layer masks! Im happy with this, I think my client is going to be happy with this as well, so Ill email a copy of the image off to my client, save my Photoshop document, close out of it, shut down my computer and go enjoy the rest of my day while I wait for the client to call me and tell me how awesome I am.

A couple of hours later, the phone rings and its my client. They like the image overall, but they think Ive removed too much of the brides veil from the photo on the right and theyd like me to bring some of it back into the image, at which point theyll be happy to pay me for my work. "No problem!", I tell them. I head back to my computer, open my Photoshop document back up, and all I need to do now is bring back some of the brides veil on the right by. by. hmm.

Uh oh. How do I do that when Ive gone and erased that part of the image?

Simple answer? I cant. Not without doing the whole thing over again, anyway, which would be my only option in this case. Theres nothing else I can do here because Ive erased that part of the image and when you erase something in Photoshop, its gone for good. If I look in the top layers preview thumbnail in the Layers palette, I can see that I have in fact erased that part of the image:

The preview thumbnail of the top layer shows the left part of the top image now missing.

And if I click on the eyeball icon to the left of the bottom layer to temporarily turn it off, leaving only the top layer visible in my document, its very easy to see that the section I erased from the left of the top image is now completely gone:

By temporarily turning off the bottom Background layer, its easy to see the missing left section of the top image.

The checkerboard pattern in the image above is how Photoshop represents transparency in an image, as in theres nothing there anymore. As in Ive messed up and now I have to do the work all over again from the beginning. Stupid Eraser Tool.

So now what? Ive tried lowering the opacity of the top layer and that didnt really work. Ive tried erasing parts of the top image away with the Eraser Tool and while that did work, I ended up permanently deleting that part of the image and now if I need to bring some of it back, I cant. I guess all I can really do then is set the number of undos in Photoshops Preferences to 100 and never close out of my Photoshop documents until after the client has paid me.

Or What about these layer masks I keep hearing so much about? Would they work out any better? Lets find out!

The Opacity option left us disappointed. The Eraser Tool did the job but also caused permanent damage to our image. Wouldnt it be great if we could get the same results we saw with the Eraser Tool but without the permanent damage to our image part? Well guess what? We can! Say hello to Photoshops layer masks.

As I mentioned at the beginning of this discussion, layer masks allow us to control the transparency of a layer, but unlike the Opacity option which controls overall transparency, layer masks allow us to set different levels of transparency for different areas of the layer (although technically, you could use them to control the overall opacity as well, but the Opacity option already handles that very well and layer masks are capable of so much more).

How do layer masks work? Well rather than talking about it, lets just go ahead and use one to see it in action. Before we can use a layer mask though, we first need to add one, since layers dont automatically come with layer masks. To add a layer mask, you first want to make sure that the layer youre adding it to is selected in the Layers palette (the currently selected layer is highlighted in blue), otherwise youll end up adding it to the wrong layer. I want to add a layer mask to the top layer, which is already selected, so Im good to go. Now if youre getting paid by the hour or you simply enjoy taking the scenic route through life, you could add a layer mask by going up to the Layer menu at the top of the screen, choosing Layer Mask, and then choosing Reveal All. If, on the other hand, you value your time and no one is paying you for it, simply click on the Layer Mask icon at the bottom of the Layers palette (its the icon that looks like a filled rectangle with a round hole in the center of it):

Add a layer mask to a layer by selecting the layer in the Layers palette and then clicking on the Layer Mask icon.

Once youve clicked on the icon, nothing will seem to have happened in your document, and thats because by default, layer masks are hidden from view. After all, the whole point of them is to show and hide different parts of the layer and it would be pretty difficult to do that if the mask itself was blocking our view of the image. So how do we know, then, that weve added a layer mask if we cant see it? Easy. Look back over in the Layers palette, to the right of the preview thumbnail on the layer you added the mask to, and youll see a brand new thumbnail. This is your layer mask thumbnail, and its how we know that a layer mask has been added to the layer:

After adding a layer mask to a layer, a layer mask thumbnail appears to the right of the layers preview thumbnail.

Notice that the layer mask thumbnail is filled with solid white. Thats not just some random, meaningless color that Photoshop users to display layer mask thumbnails in. The reason why the thumbnail is filled with white is because the mask itself is currently filled with white, even though the mask is currently hidden from view. If you want proof that the mask really is there in your document and really is filled with white, simply hold down Alt (Win) / Option (Mac) and click directly on the layer mask thumbnail in the Layers palette:

Hold down Alt (Win) / Option (Mac) and click on the layer masks thumbnail in the Layers palette.

Doing this tells Photoshop to show us the layer mask in our document, and sure enough, there it is, filled with white:

The layer mask, filled with solid white, appears in the document window.

The layer mask is now blocking our image from view though, so once again hold down Alt (Win) / Option (Mac) and click on the layer mask thumbnail to hide the mask.

So, why is the layer mask (and its thumbnail in the Layers palette) filled with white? Why not red, or green, or yellow? Its because of how layer masks work in Photoshop. Layer masks use only white, black, and all the shades of gray in between, and they use these three colors (white, black and gray) to control the transparency of a layer. White in a layer mask means 100% visible. Black in a layer mask means 100% transparent. And gray in a layer mask means some level of transparency depending on how light or dark the shade of gray is. 50% gray will give us 50% transparency. The lighter the shade of gray, the closer it is to white and the less transparent that area of the layer will be. The darker the shade of gray, the closer it is to black and the more transparent that area will be.

The reason layer masks are filled with white by default is because usually, you want to see everything on your layer when you first add the mask, and white in a layer mask means 100% visible. What if instead, you wanted to hide everything on the layer when you add the mask, so that as soon as the mask is added, everything on that layer disappears from view? Well, we just learned that black on a layer mask means 100% transparent, so we would need a way to tell Photoshop that instead of filling the new layer mask with white, we want it to be filled what black. Youll most likely come across situations where it makes more sense to hide everything on the layer when you add the mask rather than leaving everything visible, and fortunately, Photoshop gives us a couple of easy ways to do that. First of all, Im going to delete my layer mask by simply clicking on its thumbnail and dragging it down onto the trash bin icon at the bottom of the Layers palette:

To delete a layer mask, click on its thumbnail and drag it down onto the trash bin icon at the bottom of the Layers palette.

Photoshop will pop up a message asking if you want to apply the mask to the layer before you delete it. Applying the mask basically means telling Photoshop to erase all the pixels on the layer that were hidden from view by the layer mask, as if you had erased them yourself with the Eraser Tool. This way, you can delete the mask without losing the work youve done with it, although youll lose the ability to make any changes later. In my case, I havent actually done anything with my mask so theres nothing to apply, so Im simply going to press Delete. Most times, if you find yourself deleting your mask, it will be because youre unhappy with it and want to start over, in which case youll just want to click Delete as well:

In most cases, youll simply want to delete your mask and start over, but there are times when you may want to apply the mask to the layer before deleting it, which will erase all the pixels on the layer that were hidden by the mask.

Now that Ive deleted my mask, both the mask itself and its thumbnail in the Layers palette are gone:

When you delete a layer mask, its thumbnail in the Layers palette also disappears.

This time, I want to add a mask to the top layer and have Photoshop hide everything on the layer as soon as the mask is added, which means the mask will need to be filled with black instead of white. The getting paid by the hour way to accomplish this would be to go up to the Layer menu at the top of the screen, choose Layer Mask, and then choose Hide All (remember last time, we chose Reveal All). The faster and easier way though is to hold down your Alt (Win) / Option (Mac) key and click on the Layer Mask icon at the bottom of the Layers palette:

old down Alt (Win) / Option (Mac) and click on the Layer Mask icon.

Either way you choose to do it, Photoshop adds a new layer mask to the currently selected layer, just as it did before, but this time, it fills the mask with black instead of white. We can see this in the layer mask thumbnail which is filled with solid black:

The new layer mask thumbnail is filled with black.

And, unlike the first time we added a layer mask where nothing seemed to have happened to our image, this time the top layer (the photo of the couple facing the camera) is completely hidden from view, leaving only the image below it visible:

The photo on the top layer is now 100% transparent, leaving only the photo below it visible in the document.

Once again, the layer mask itself is hidden from view, but if you want to see it in your document, hold down Alt (Win) / Option (Mac) and click directly on the layer masks thumbnail in the Layers palette, which will tell Photoshop to show you the mask in the document window. This time, the mask is filled with black:

Hold down Alt (Win) / Option (Mac) and click on the layer mask thumbnail in the Layers palette to view the mask in the document, which is filled with solid black.

Hold Alt/Option and click again on the layer mask thumbnail to hide the mask in the document when youre done.

This is where the important difference between the Eraser Tool and layer masks comes in. Remember when we used the Easer Tool to blend the images together by erasing away part of the left side of the top image? The Eraser Tool physically deleted that part of the image and it was forever gone at that point, and if we looked in the top layers preview thumbnail, we could see that large chunk of the image missing on the left. This time though, weve used a layer mask to hide not just part of the left side of the image but rather the entire image, yet if we look in the layers preview thumbnail, the image is still there, completely intact:

The image on the top layer is still intact on the layer, as shown in the layers preview thumbnail, even though its hidden from view in the document.

Where the Eraser Tool deleted the contents of the layer, the layer mask simply hides it from view! To prove that the photo on the top layer is still there, Im going to fill the layer mask with white. To fill a layer mask with white, or do anything at all with a layer mask, you first need to select the mask so that youre working on the mask itself and not the actual layer, and to select it, all you need to do is click directly on the masks thumbnail in the Layers palette:

Select a layer mask by clicking on its thumbnail in the Layers palette.

You can switch between selecting the layer itself and its layer mask by clicking on the corresponding thumbnail. You can tell which one is currently selected by which thumbnail has the white highlight border around it, as we can see around the layer mask thumbnail in the image above.

To fill the mask with white, Ill go up to the Edit menu at the top of the screen and choose Fill, which brings up Photoshops Fill command dialog box. For Contents Ill choose white:

Photoshops Fill dialog box.

With white chosen as my fill contents, Ill click OK in the top right to exit out of the dialog box and have Photoshop fill my layer mask with white. I can now see in the Layers palette that the mask thumbnail is filled with white:

The layer mask thumbnail in the Layers palette is now filled with white.

And with the mask now filled with solid white, my photo on the top layer is completely visible in the document once again, proving that even though the image was hidden from view a moment ago when we filled the layer mask with black, it was always there, untouched and unharmed:

After filling the layer mask with white, the photo on the top layer becomes fully visible once again.

And thats the basics of how Photoshops layer masks work! When the mask is filled with white, the contents of that layer are 100% visible in the document, and when the mask is filled with black, the contents of the layer are 100% transparent hidden from view but not deleted as was the case with the Eraser Tool. Layer masks dont physically alter or affect the contents of the layer in any way. All they do is control which parts are visible and which are not. The contents of the layer are always there, even when we cant see them.

"Okay," youre wondering, "Weve seen how we can hide a layer completely by adding a layer mask to it and filling it with black, and weve seen how we can show the layer completely once again by simply filling the layer mask with white. And we know that whether the contents on the layer are visible or not, theyre still always there. The Eraser Tool deletes parts of the image but layer masks simply hide them. Thats all great. But is this all we can do with a layer mask, either show the entire layer or hide it? How do we use a layer mask to blend these two images together like we did with the Eraser Tool?"

Excellent question, and the answer is, very easily! Well do that next.

To blend the two images together using the layer mask, we dont use the Eraser Tool. In fact, while the Eraser Tool still has its place, youll find yourself using it less and less as you become more comfortable with layer masks. Instead, we use Photoshops Brush Tool, and with our layer mask filled with white as it currently is, which is making the entire layer visible, all we need to do is paint with black on the layer mask over any areas we want to hide. Its that simple!

To show you what I mean, Im going to select my Brush Tool from the Tools palette:

Selecting Photoshops Brush Tool from the Tools palette.

I could also press B on my keyboard to quickly select it. Then, since we want to paint with black, we need to have black as our Foreground color, and by default, whenever you have a layer mask selected, Photoshop sets white as your Foreground color, with black as your Background color. To swap them so black becomes your Foreground color, simply press X on your keyboard. If I look in the color swatches near the bottom of my Tools palette, I can see now that black is my Foreground color:

Photoshops Tools palette showing black as the Foreground color.

Im going to resize my brush to the same general size I used with the Eraser Tool by once again using the left and right bracket keys, and I want my brush to have nice, soft edges so I get smooth transitions between the areas of the layer that are visible and the areas that are hidden, and I can soften my brush edges by holding down Shift and pressing the left bracket key a few times. Then, with my layer mask selected (I know its selected because the layer mask thumbnail has the white highlight border around it), Im going to do basically the same thing I did with the Eraser Tool, except this time Im painting with black on the layer mask over the areas I want to hide rather than erasing anything:

Paint with black over areas that you want to hide.

After spending a few more seconds painting away the areas I want to hide, heres my result, which looks pretty much the same as it did after I used the Eraser Tool:

The image after painting away the left part of the top image to blend it with the image below.

If we look at the layer mask thumbnail in the Layers palette, we can see where Ive painted with black, which are now the areas of the top image that are hidden from view:

The layer mask thumbnail now shows the areas Ive painted with black.

Lets say Im happy with this, and I think my client will also be happy with it, so just as before, I email the image to the client for their approval, save my Photoshop document, close out of Photoshop and shut down my computer. The client calls back a couple of hours later and says they like it but they want some of the brides veil on the right brought back in. When I faced this situation after using the Eraser Tool, I was out of luck because I had deleted that part of the image and had no choice but to start all over again. This time though, I was smarter! I used a layer mask, which means that the entire image on the top layer is still there and all I need to do is make more of it visible!

I was able to hide parts of the layer initially by painting on the layer mask with black, so to bring back some of the image thats now hidden, all I need to do is press X on my keyboard to swap my Foreground and Background colors, which makes white my Foreground color, and then I can simply paint with white over the areas I want to bring back into view, again making sure that my layer mask, not the layer itself, is selected, otherwise Ill be painting directly on the photo itself, and Im fairly certain the client wouldnt approve of that. I think Ill use a smaller brush this time with harder edges so there isnt such a large transition area between the two images, and Ill use the brides veil, along with the tree trunk above her, as the dividing point between the two images, which will look more natural. As I paint with white on the layer mask, the areas I paint over that were hidden become visible once again:

Painting with white on the layer mask with white to bring back some of the image I had hidden originally by painting with black.

If I make a mistake as Im painting and accidentally show or hide the wrong area, all I need to do is press X to swap my Foreground and Background colors, paint over the mistake to undo it, then swap my Foreground and Background colors once again with X and continue on. And here, after a couple of minutes worth of work painting the veil and the tree trunk back into the image, is my final result:

The final result.

Thanks to the layer mask, I didnt have to redo everything from scratch because nothing was deleted! The mask allowed me to hide parts of the layer without harming a single pixel, Not only does this give you a lot more flexibility, it also gives you a lot more confidence when working in Photoshop because nothing you do with a layer mask is permanent.

And there we have it! Thats the basics of how layer masks work in Photoshop! Check out our Photoshop Basics section for more great tutorials on layers and other essential Photoshop skills!

Download our tutorials as print-ready PDFs! Learning Photoshop has never been easier!

You May Also Like...


Understanding Layer Masks In Photoshop
Learn all about layer masks in Photoshop. Perfect for beginners! Part of our complete Photoshop Layers tutorials collection.

Photoshop For Beginners: Understanding Layer Masks
Understanding Layer Masks. 47. Today I will show you one of the most powerful Photoshop tool: layer masks. Also you cant apply a layer mask if the

Photoshop: Understanding Layer Masks
http://www.lourceyphoto.com - An introduction to layer masks in Photoshop. Why you should use them and how to do it.

Understanding Layers in Photoshop - Digital Photography School
This post on Understanding Layers in Photoshop has been submitted by Jodi You will have or can add layer masks so that you can work selectively on your photo

Understanding Layer Masks in Photoshop Elements {and ...
Tutorial explaining white and black masks in Photoshop Elements and Photoshop.

Understanding layer mask basics from the Course Photoshop ...
Understanding layer mask basics. Throughout this course, you have heard me talk about the value of nondestructive editing. In other words, using Photoshop techniques

Layer Masks in Photoshop Elements 11 - For Dummies
Photoshop Elements 11. A layer mask Understanding Using the Computer; Converting; Editing; Photo Files; Popular Software; Scanning; Transferring; Popular

Understanding layer masks from the Course Photoshop ...
Taught by Jan Kabili as part of the Photoshop Elements 10 Essential Training. Understanding layer masks. Photoshop CC Essential Training.

Photoshop 101: Understanding Layers and Masks - Steve's ...
In Photoshop, this is accomplished by using layers and masks. These terms you have probably heard before, but to have a complete understanding of them and their use

Photoshop CS6 Tutorial - Understanding Layer Masks
Photoshop CS6 Tutorial for Beginners - Understanding Layer Masks. Subscribe, comment, and like for more free tutorials! Visit www.hunkim.com for all my

Previous
Next Post »