Sub topic 8
Blend the Images by Painting on the Mask
This chapter covers the working model of mask painting and the errors that most often ruin a blend. It assumes you can open and save images, find the Layers panel, and know what a layer is. It also assumes you have already added a layer mask, where white reveals and black conceals, as covered in the previous chapter. Here you will use the Brush tool on that mask to blend the second photo into the first.
The working model: a mask is a grayscale image
A layer mask is a grayscale image attached to a layer. Photoshop reads each pixel of the mask as a visibility value for the matching pixel of the layer:
- White (100%) shows the layer fully.
- Black (0%) hides the layer fully.
- Any gray shows the layer partly. Mid-gray (50%) shows about half of it.
Painting on a mask never touches the photo's own pixels. You change only the mask, so you can undo a bad stroke by painting the opposite color. This is why masks are preferred over the Eraser tool. The Eraser deletes pixels for good, while a mask only hides them.
Because the mask holds gray values, the Brush tool becomes a blending tool. A soft brush at low opacity builds up gray gradually, and gray gives you a gradual transition between the two photos.
Set up before you paint
Three things must be true before your first stroke lands where you expect.
- The mask thumbnail is active. In the Layers panel, click the mask thumbnail (the black-and-white rectangle on the right of the layer). A thin border appears around the mask thumbnail when it is selected. If the border is around the photo thumbnail instead, your strokes will paint color onto the photo itself.
- The Brush tool is selected. Press
B. - The default colors are set. Press
Dto reset the foreground and background to black and white. On a mask, Photoshop then shows black as foreground and white as background. PressXto swap them.
A quick check: with the mask active, the Foreground color shows only grays. If you paint and see red or green appear on your photo, you are on the pixel layer. Undo with Ctrl+Z (Cmd+Z on Mac) and click the mask thumbnail.
Brush settings that control the blend
The Options bar and the Brush Settings panel hold the controls that matter. Four of them decide how a blend looks.
| Setting | What it does | Typical starting value for blending |
|---|---|---|
| Size | Diameter of the brush | Large enough to cover the transition area in a few strokes |
| Hardness | How sharply the brush edge falls off | 0% to 20% for blending, 80% to 100% for crisp edges |
| Opacity | Maximum strength of one stroke | 20% to 40% for gradual buildup |
| Flow | How fast paint accumulates while you hold the mouse button | 100%, or lower for a slow buildup |
Opacity and Flow behave differently, and this causes confusion. Opacity sets a ceiling for a single stroke. If Opacity is 30%, one continuous stroke can never go darker than 30% gray, no matter how many times you cross the same spot before releasing the button. Flow controls how quickly paint builds up toward that ceiling within the same stroke. Releasing the mouse button ends the stroke, and the next stroke adds on top of the previous one. That is how you build up 30%, then 51%, then 66% in repeated passes.
You can change these without opening panels:
[and]make the brush smaller or larger.Shift+[andShift+]make it softer or harder.- Number keys set opacity:
3gives 30%,5gives 50%, and typing two digits quickly such as2then5gives 25%.
Worked example: blend a sky into a landscape
Suppose you have a landscape photo as the bottom layer and a dramatic sky photo above it. You want the sky to replace the dull sky and fade into the horizon.
- Select the sky layer and click its mask thumbnail. If the layer has no mask yet, click the Add Layer Mask button at the bottom of the Layers panel. A white mask makes the whole sky layer visible.
- Press
B, then set Hardness to 0% and Opacity to 100%. - Press
Dso black is the foreground. Paint over the lower part of the sky layer, where it covers the landscape. The landscape appears through the black areas. - Lower Opacity to 30%. Paint along the horizon where the two photos meet. Each pass lets a little more of the landscape through, so the join softens.
- Press
Xto switch to white. At low opacity, paint back any part of the sky that you hid too much. - Zoom to 100% (
Ctrl+1orCmd+1) and check the horizon for halos or hard lines.
A gradient is often faster than a brush for a long straight transition like a horizon. Select the Gradient tool (G), choose the Foreground to Background preset, and drag a short line across the mask. White-to-black gives a smooth fade. Use the brush afterward for the detail work, such as trees that poke above the horizon.
Alt-click to see what you are really painting
When you cannot tell what the mask looks like, view it alone.
Alt+click(Option+clickon Mac) the mask thumbnail. The canvas shows the mask as a grayscale image. Click it again the same way to return.\(backslash) toggles a red overlay on the image that shows the masked areas. This is helpful for finding leftover patches.Shift+clickthe mask thumbnail to disable the mask temporarily. A red X appears over the thumbnail. Repeat the click to enable it. Use this to compare before and after.
Common errors and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
| Color paint appears on the photo | The pixel layer is active, not the mask | Undo, click the mask thumbnail, check for the border |
| Nothing seems to happen | Foreground color matches what is already there, or Opacity is very low | Press `X`, check Opacity, and check that you are not painting white on white |
| A hard, visible line along the stroke edge | Hardness is too high | Press `Shift+[` or set Hardness to 0% |
| Hair, grass, or leaves look cut out | Mask edge is too crisp, or you hid parts with a hard brush | Paint at low opacity with a soft brush, or use the refinement tools in the next chapter |
| Gray patches make the layer look washed out | You painted gray where you meant black or white | View the mask with `Alt+click` and repaint the area with pure black or white |
| Brush paints only in a straight rigid line | Shift key held down | Release `Shift`. Holding it constrains the stroke to a line |
| Dark halo around the subject | Mask edge includes background pixels | Paint white or black slightly inside the edge, or refine the edge |
Working habits that keep masks clean
- Paint in layers of effort. Start big and soft to establish the transition. Reduce the brush size and opacity as you reach details.
- Zoom in for edges. At fit-to-screen view, a few pixels of error are invisible. At 100% they are not, and your final export may be viewed at that size.
- Prefer low opacity over one heavy stroke. A correction at 20% is easy to adjust. A heavy stroke at 100% is a decision you must undo.
- Do not paint on the mask with the Eraser. The Eraser does not behave like a brush on masks in every setup, and using it only adds confusion. Use black and white paint.
- Keep a backup of the mask. Drag the mask thumbnail to the New Layer button? That does not copy it. Instead,
Alt+dragthe mask to another layer to copy it, or save the selection through the Channels panel before a risky edit.
How the process flows
Edge cases
- Layers with a Smart Object. You can add and paint a mask on a Smart Object layer exactly as on a normal layer. The mask is separate from the embedded content, so scaling the Smart Object later keeps the original quality.
- Linked masks. A small chain icon sits between the layer thumbnail and the mask thumbnail. When linked, the mask moves and scales with the layer. Click the chain to unlink if you want to move the photo while keeping the mask in place.
- Pen pressure. With a drawing tablet, you can map pen pressure to Opacity or Size in Brush Settings under Transfer or Shape Dynamics. This gives natural-looking, varied strokes. A mouse works fine, only with more passes.
- Painting on a selection. If a selection is active, strokes only affect the area inside it. A forgotten selection is a common reason why part of the canvas will not paint. Press
Ctrl+D(Cmd+D) to deselect. - Color mode and bit depth. Masks work the same in 8-bit and 16-bit. In 8-bit files, very strong gradients can show visible bands. Adding a little noise or working in 16-bit reduces this.
Exercises
Exercise
You paint a soft black stroke at 30% Opacity and drag back and forth over the same spot without releasing the mouse button. The area never gets darker than 30% gray. Why, and how do you make it darker?
Show answer
Opacity is a ceiling for a single stroke, so one continuous stroke cannot exceed 30% no matter how many times you cross it. Release the mouse button and paint again. Each new stroke adds up to another 30% on top of the previous result. You can also raise the Opacity setting.
Exercise
You start painting on a layer mask with the Brush tool, but red paint appears on the photo instead of changing the blend. What is wrong, and what do you do?
Show answer
The photo's pixel layer is active instead of the mask. Undo the strokes with Ctrl+Z (Cmd+Z on Mac), click the mask thumbnail in the Layers panel so a border appears around it, and paint again with black or white.
Exercise
Name two ways to inspect the mask by itself, or to turn it off, so you can see what you have painted.
Show answer
Alt+click (Option+click on Mac) the mask thumbnail to view the mask as a grayscale image. Shift+click the mask thumbnail to disable it temporarily, which shows the layer without the mask. Pressing the backslash key to show a red overlay is also acceptable.