Sub topic 1
Layers and masks: the foundation for every effect
Every shadow and reflection in this tutorial is a separate layer that you place, blend, and fade with a mask. If you understand how layers stack and how masks hide pixels, the later chapters become a repeated set of steps. If you don't, you will paint on the wrong thing and lose work. This chapter gives you the working model and the errors that most often cause trouble.
Prerequisites
This chapter assumes you can already do the following:
- Navigate the Photoshop interface: open the Layers and Properties panels, choose tools from the toolbar, and open and save documents.
- Create layers and change layer opacity.
- Make a selection with the Lasso or Marquee tools and use Move and Free Transform.
You do not need to know masks or blend modes yet. This chapter covers masks, and blend modes come in a later chapter.
The working model: a stack of layers
A Photoshop document is a stack of layers. Photoshop composites them from bottom to top, so a layer sits in front of everything below it and behind everything above it. Stacking order is the first thing you control when you build a shadow. A shadow must sit below the subject but above the ground.
You will work with these layer types:
| Layer type | What it holds | Use in this tutorial |
|---|---|---|
| Pixel layer | Raster pixels you can paint on | Shadow shapes, the flipped reflection |
| Group | A folder of layers | Keeping a subject, its shadow, and its reflection together |
| Adjustment layer | A color or tone correction that affects the layers below it | Matching tone later on |
| Smart Object | A layer that keeps the original source data | Reversible transforms and filters |
Two properties of each layer matter for this chapter:
- Opacity controls how visible the whole layer is, from 0 to 100 percent.
- A layer mask controls how visible each individual pixel is.
Opacity applies one value to the whole layer. A mask lets different parts of the layer have different visibility, and that is what makes a shadow fade out as it moves away from the subject.
How a layer mask works
A layer mask is a grayscale image attached to a layer. Photoshop reads it pixel by pixel:
- White means the layer pixel is fully visible.
- Black means the layer pixel is fully hidden.
- Gray means the layer pixel is partly visible. A 50 percent gray gives 50 percent visibility.
A mask hides pixels without deleting them. If you erase part of a layer with the Eraser, those pixels are gone. If you paint black on a mask, the pixels are still there, and you can paint white to bring them back. This is why masks are the basis of non-destructive work, which the next chapter extends with Smart Objects and adjustment layers.
Creating a mask
- Select the layer in the Layers panel.
- Click the Add Layer Mask button at the bottom of the panel. This creates a white mask, so nothing is hidden yet.
- To start with everything hidden, hold Alt (Windows) or Option (Mac) while you click the button. This creates a black mask.
If you have an active selection when you click the button, the selected area becomes white and everything else becomes black. This is the usual way to turn a cut-out selection into a mask. The next chapter covers making the selection itself.
Editing a mask
After you create a mask, the layer shows two thumbnails: the image on the left and the mask on the right. The thumbnail with a white border around it is the one that receives your edits. Click the one you want to edit.
When the mask thumbnail is active, you can paint on it with any tool that paints:
- Press D to reset the foreground and background colors to black and white.
- Press X to swap them, so you can switch between hiding and revealing.
- A soft round Brush with low opacity gives a gradual, blended edge. A hard brush gives a sharp edge.
- The Gradient tool (G) with the black-to-white preset makes a smooth fade across the mask. You will use this for shadow falloff and reflection fades in later chapters.
Useful shortcuts for working with masks:
| Action | Windows | Mac |
|---|---|---|
| View the mask alone | Alt-click the mask thumbnail | Option-click the mask thumbnail |
| Disable the mask temporarily | Shift-click the mask thumbnail | Shift-click the mask thumbnail |
| Invert the mask | Ctrl+I | Cmd+I |
| Load the layer's transparency as a selection | Ctrl-click the layer thumbnail | Cmd-click the layer thumbnail |
Viewing the mask alone is the fastest way to check an edit. A red tint or a stray gray patch that you cannot see in the normal view will show up in the mask view.
Mask properties
With the mask thumbnail selected, the Properties panel shows controls that change the mask without repainting it:
- Density scales how strongly the mask hides. At 100 percent, black is fully hidden. At 60 percent, black hides only 60 percent, which lets some of the layer show through.
- Feather blurs the mask edge. This is a fast way to soften the boundary of a cut-out, and you can adjust it at any time.
Both settings are reversible. You will use Feather often when you soften shadow edges.
Linking, moving, and transforming
By default, a layer and its mask are linked. The small chain icon between the two thumbnails shows this. When you move or transform the layer, the mask moves and scales with it.
This is usually what you want. It becomes a problem when you want to reposition the layer but keep the mask in place, or the reverse. Click the chain icon to unlink them. A common case is a reflection: you flip the layer, and the gradient mask on it should stay where it is. Check the link state before every transform.
Clipping masks
A layer mask hides parts of the layer it belongs to. A clipping mask works differently: it limits one layer to the shape of the layer below it.
To clip a layer, hold Alt (Windows) or Option (Mac) and click the line between the two layers in the Layers panel. You can also press Ctrl+Alt+G (Windows) or Cmd+Option+G (Mac). The clipped layer shows a small arrow and is indented.
For shadows, this is useful when a tone correction should only affect the shadow below it and not everything underneath. Clipping an adjustment layer to a shadow layer limits the adjustment to the shadow's pixels. Prefer the clip to a mask when the shape you want to follow already exists as a layer.
Common errors
Most problems in later chapters trace back to one of these mistakes.
- Painting on the layer instead of the mask. If the layer thumbnail is active, your black paint appears as black pixels on the image. Look for the border around the thumbnail before you paint. If you made this mistake, undo with Ctrl+Z or Cmd+Z and click the mask thumbnail.
- Using the Eraser on a layer that needs to stay editable. Erased pixels are gone. Paint black on a mask instead.
- Reversed black and white. If the mask hides what you wanted to show, press X to swap colors, or press Ctrl+I or Cmd+I to invert the whole mask.
- A gradient with the wrong direction. Black at the start of the drag hides the start. Reverse the drag or invert the mask.
- A linked mask that moved when you transformed. Unlink with the chain icon, make the transform, and decide whether to relink.
- Painting on a hidden or locked layer. Photoshop shows a warning or refuses to paint. Check the eye icon and the lock icons.
- A layer in the wrong place in the stack. A shadow that appears over the subject usually just needs to be dragged below it.
Why this matters for shadows and reflections
Two properties of masks do most of the work in the rest of this tutorial.
- Gradual visibility. A gradient on a mask makes a shadow or reflection fade smoothly over distance, which is how real shadows and reflections behave.
- Reversibility. You can try a gradient, see that the fade is too short, and repaint it, with no loss of pixels.
When you start a new effect, ask yourself which layer holds the pixels, which mask controls their visibility, and where in the stack they belong. Those three questions apply to every chapter that follows.
Exercise
You have a pixel layer called "Shadow" with a layer mask. You pick the Brush, set the foreground color to black, and paint across the shadow. The shadow's pixels stay visible, but black marks appear on top of them. What went wrong, and how do you fix it?
Show answer
The layer thumbnail was active instead of the mask thumbnail, so the black paint went onto the layer's pixels. Undo the stroke with Ctrl+Z (Cmd+Z on Mac), click the mask thumbnail so it has the border around it, and paint again. Black on the mask will now hide the shadow instead of marking it.
Exercise
You flipped a reflection layer vertically, and its gradient mask flipped along with it, so the fade now runs the wrong way. What setting caused this, and how do you avoid it?
Show answer
The layer and its mask were linked, so the transform applied to both. Click the chain icon between the thumbnails to unlink them before you transform the layer. Then the mask stays in place while the layer flips.