Adobe Photoshop Tutorials - Understanding Layer Masks in Photoshop

Understanding Layer Masks In Photoshop

Learn Photoshop with Photoshop Basics Tutorials at Photoshop Essentials.com

The Opacity option left us disappointed. The Eraser Tool did the job but also caused permanent damage to our image. Wouldn't 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 Photoshop's 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, let's 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 don't automatically come with layer masks. To add a layer mask, you first want to make sure that the layer you're adding it to is selected in the Layers palette (the currently selected layer is highlighted in blue), otherwise you'll end up adding it to the wrong layer. I want to add a layer mask to the top layer, which is already selected, so I'm good to go. Now if you're 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 (it's 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 you've clicked on the icon, nothing will seem to have happened in your document, and that's 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 we've added a layer mask if we can't 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 you'll see a brand new thumbnail. This is your layer mask thumbnail, and it's 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 layer's preview thumbnail.

Notice that the layer mask thumbnail is filled with solid white. That's 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 mask's 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 it's thumbnail in the Layers palette) filled with white? Why not red, or green, or yellow? It's 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. You'll 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, I'm 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 you've done with it, although you'll lose the ability to make any changes later. In my case, I haven't actually done anything with my mask so there's nothing to apply, so I'm simply going to press "Delete". Most times, if you find yourself deleting your mask, it will be because you're unhappy with it and want to start over, in which case you'll just want to click "Delete" as well:

In most cases, you'll 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 I've 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 mask's 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 you're done.

New! Download our Photoshop tutorials as convenient, print-ready PDFs!

Go to page: 1 | 2 | 3 | 4 | 5