From the course: Photoshop 2024 Essential Training
Layer mask essentials - Photoshop Tutorial
From the course: Photoshop 2024 Essential Training
Layer mask essentials
- [Instructor] Layer masks are a key feature of Photoshop that allow us to non-destructively hide and show selective portions of our image. In a previous chapter, we used the Frame tool, which is great for simple rectangles and ovals, but layer masks are much more powerful. So in this document we have five layers. We have the sky layer, the water, the bottle, the giraffe, and the texture, and I want to put the giraffe in the bottle and make it look like it's in the water. I'm going to target the water layer and I need to add a layer mask. I'll choose the Layer menu, and then Layer Mask, and then Reveal All. We can see that the mask is added and the mask is white. So wherever I see white in the mask, I'm going to be able to see the content of that layer. Wherever I paint with black in the mask, it's going to hide the contents of the layer. I'll tap the B key in order to select my paintbrush, and then right-click on the brush and just reset the tool. Then I'm going to want to get a larger brush, so I'll hold down the right bracket key. And I want to make sure that I'm painting with 100%, and with black as my foreground color. Now wherever I paint, I'm going to hide the information on that layer. I can paint as many times as I want to and continue to hide the information. Now, if I paint somewhere and I go a little bit too far and I want to undo that, I can either use Command + Z to undo it, or I can tap the double-headed arrow here to swap the foreground and background color, or you can just tap the X key. Now that I'm painting with white, wherever I paint in the image, I'm going to see the contents of that layer. And I'm using a soft brush right now because it's going to create a gentler transition between the areas that are masks and those that aren't. But if you had a very hard-edged object, then you would probably want to use a smaller, harder edged mask. All right, if I want to change the opacity of the brush, I can do so. I can tap five, and that will change the opacity, and now I could continue to paint. If I want to hide the contents of the layer, I'll make sure that I tap X so that I'm painting with black, and I can come in here and selectively hide these additional areas. Again, I can tap X if I want to show them. If I want to view the mask, I can hold down the Option key on Mac or the Alt key on Windows, and click on the layer mask thumbnail in the Layers panel. To show the image again, I'll click on the eye icon. And to temporarily toggle the visibility of the mask, I can hold down the Shift key and click on it, hold the Shift key and click again in order to reveal it. Now I've made a little bit of a mess of this, so I could drag the layer mask to the trash can at the bottom of the Layers panel, but then it's going to ask me if I want to delete it. So it's easier to just right-click and choose to delete the layer mask. I want to add a layer mask again though, so I want to point out that the quicker way to do this would probably be to add the mask from the bottom of the Layers panel. It automatically added the white mask, but this time, instead of painting, I'm going to use the Gradient tool. I'll tap the G key, and then I'll want to right-click just to reset the tool. Then I'll tap D in order to set my default colors, so the foreground color's white and it transitions to black, and we can see that in the preview here. I'm going to select the linear gradient. And then, because the white area is the area that I want to see, I'll start dragging down here, and then drag up towards the top of the image. If I hold down the Shift key, that will constrain that to a horizontal or vertical line or an increment of 15%. Once I release my cursor, I can still change the gradient using the onscreen controls, so I can reposition the gradient by dragging the line, I can extend the gradient by dragging either one of the endpoints. But I don't want to go too far, because this photograph on the water layer ends right here. So if I extend this too far, we're going to see that line where that image ends, so I want to bring that down. If I want to change the midpoint, I can drag on the diamond shape, and you can see in the Properties panel as I drag what's happening to the gradient. If I ever needed to reverse the gradient, I would want to choose the Reverse box in the Properties panel. I don't want to use Command + I to invert it, because if I do that, it will change it from this live gradient to a bunch of pixels. There are a number of different styles that we can choose. So with these live gradients, we can actively move between them. But gradients are going to be covered in more depth later in this course, so for now, I'll keep the linear gradient. You can also separate the layer from the mask. If in the Layers panel I click on the link icon, now I can select the Move tool by tapping the V key, target the photograph, and now we can reposition the photograph in the canvas without moving the mask. All right, I'll relink those, and now let's work on the bottle. I'll target the bottle layer and make it visible. And then, use the contextual task bar in order to select the subject. This will select the bottle, and now I can use the mask icon, and because I have a selection, Photoshop will automatically add a mask that reveals the selection, but hides the rest of the image. With the Move tool selected, I will reposition this over here on the right-hand side. We can see the mask of the bottle where the mask is white, we can see the bottle, where it's black, it's hidden all the background. I want to transform this, so I will select the Layer thumbnail, choose Edit, and then Transform, and then Rotate. Now, the reason that the bounding box is rectangular is because it's going all the way around the mask because the mask is going to transform with the bottle. So let's just put that at an angle, bring it down a bit, and then apply that transformation. Now this layer already has a layer mask, and there are times when you may not want to change the layer mask that you already have, but you want to add another layer mask to the same layer. Well, the way to do this would be to put this into a group. So I'll drag it down to the folder icon, that's the group icon, and that will create a group, and then I can add a layer mask to that group. This is also going to enable me to put the giraffe within this group and have it use the same mask to mask it into the water. So, in this case, I'll tap B to select the Brush tool. I'll get a little bit smaller of a brush, make sure that I'm painting with 100%, so I'll tap the zero key. And then, I want to be painting with black, so I'll tap X. And then, we can just paint here in order to hide that area. I might want that a little bit more defined, so I'm going to use a little bit smaller of a brush and then paint, and then tap X in order to paint this area in. Oh, I went a little too far, so let's take that out. All right, next, let's work with the giraffe. I will target it and make it visible. And then, we will click on Remove Background in the contextual text bar. Once it has removed the background, we can see that it's automatically added a layer mask for us. So now we just need to select the layer and choose Edit, and then Transform, and Scale. We'll scale down the giraffe so that it's going to fit within this bottle, maybe a little bit larger and reposition that. I'll click Done, and then I'll place the giraffe layer inside of the group by dragging it down in the Layers panel. And now we can see that the giraffe is being masked by that mask that's being applied to the group. Then I'll change the opacity of the giraffe layer. Now, if I want to use my numeric keys to do this, right now, because I have the brush selected, it would change the opacity of the brush. So I'll select the Move tool, and then I'll tap maybe eight to set it to 80%, and then I'll select the bottle and decrease the opacity maybe also to 70 or 80%. I think I prefer it around 80. Let's try 90, I think that looks even better, and let's bring up the giraffe to 90% as well. Nope, I like that better at 80. I want to darken down this area a little bit, so I'll add a new layer. And then, I'll tap B for my brush tool again, making sure that I have black as my foreground color, and I'm just going to paint in a shadow here. But you'll notice that this is also being masked by the group's layer mask. So I'm going to bring layer one up above and out of that group, and then just decrease the opacity so we see a little bit of a shadow there. Finally, I'll select the Texture layer, use the eye icon to make it visible, and I'm going to change the blend mode to soft light to add a soft texture over the entire image, and then I'll just decrease the opacity to make it even more subtle. Okay, one warning before we wrap up. At this point in time, I could return to the water mask and tap the G key to select the gradient, and I can still make changes to this gradient. However, once I save this file and close it, the next time I reopen it, the mask that was created by the gradient will turned into just a regular pixel-based mask and will not show the onscreen controls. You can always redraw it, but I just wanted to give you a heads up. So I think one of the most difficult things when you're learning layer masks in Photoshop is just remembering to target the mask when you want to work on the mask and targeting the layer when you want to work on the layer. But if you remember that where the mask is white, you can see the information on the layer, and where the mask is black, the information is hidden, then you'll have no trouble at all masking in Photoshop.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.