Sub topic 12
Stacking order, opacity, and blend modes
This chapter assumes you can create Levels, Curves, and Hue/Saturation adjustment layers, edit them in the Properties panel, and limit them with masks and clipping. Here you will learn how several adjustment layers combine, why their order changes the result, and how to use opacity and blend modes to control how strongly each one acts.
How a stack of adjustments is evaluated
Photoshop evaluates the Layers panel from the bottom up. Each adjustment layer receives the combined result of everything below it as its input. It changes those values and passes the new result upward.
An adjustment layer is a function applied to pixel values. A stack of adjustments is therefore a composition of functions, and composing functions is not commutative in general. Swapping two layers can change the output.
This is easy to see with the two code examples from earlier chapters. The levels function clips values outside the black and white points. The curve function reshapes whatever values arrive. If a Curves layer sits below Levels, Levels sees the values after the curve has moved them. If Levels sits below Curves, the curve sees the values after the clipping and rescaling.
def levels(value, in_black=0, in_white=255, gamma=1.0, out_black=0, out_white=255):
"""Map one 8-bit channel value the way a Levels adjustment does."""
t = (value - in_black) / (in_white - in_black)
t = min(max(t, 0.0), 1.0)
t = t ** (1.0 / gamma)
return round(out_black + t * (out_white - out_black))
def curve(value, points):
"""Look up an 8-bit value on a curve defined by (input, output) control points."""
pts = sorted(points)
for (x0, y0), (x1, y1) in zip(pts, pts[1:]):
if x0 <= value <= x1:
return y0 + (y1 - y0) * (value - x0) / (x1 - x0)
raise ValueError("value is outside the curve's input range")
s_curve = [(0, 0), (64, 48), (192, 208), (255, 255)]
def levels_then_curve(v):
return curve(levels(v, in_black=40, in_white=215), s_curve)
def curve_then_levels(v):
return levels(round(curve(v, s_curve)), in_black=40, in_white=215)
for v in (30, 60, 100, 200):
print(v, levels_then_curve(v), curve_then_levels(v))The two columns of output differ. In the first order, Levels stretches the range first and the S-curve then adds contrast to the stretched values. In the second order, the curve acts on the original values and Levels then clips and stretches the result. For input 60, the first order gives about 20 and the second gives about 8.
Common ordering rules
There is no single correct order, but a few conventions work for most photos. They follow from one principle: fix the tonal foundation before you style it.
- Put tonal corrections (Levels, Curves) at the bottom. Setting black and white points early gives later layers a full range of values to work with.
- Put color corrections (color cast fixes, Hue/Saturation) above the tonal layers.
- Put creative or stylistic adjustments near the top, where they are easy to find and toggle.
- Keep local, masked adjustments next to the global layer they refine, or group them.
The tonal-first rule has a practical reason. A Hue/Saturation layer that boosts saturation reacts to the brightness values beneath it. If you later change the exposure with Levels placed below it, the saturation boost lands on different pixels than you judged earlier. Placing Levels first keeps the judgment stable.
Layers that the order affects most
Order matters most when a layer clips or compresses values, because clipped values cannot be recovered by layers above. A Levels layer that moves the white point below 255 sends all brighter values to pure white. A Curves layer above it cannot restore the lost detail, because the detail no longer exists in the data it receives.
Order matters least between two adjustments that operate on independent properties. A Hue/Saturation layer that shifts hue only and a Curves layer that adjusts only luminosity will often give results that look close in either order. Close is not identical, because RGB curves change saturation as a side effect.
Opacity: scaling an adjustment's strength
Every adjustment layer has an Opacity setting at the top of the Layers panel. It controls how much of the layer's effect is blended with the result below. At 100% you see the full adjustment. At 0% you see none. At 50% you see the average of the input and the fully adjusted output.
Opacity is a linear blend. For one channel value, the displayed result is:
def apply_opacity(before, after, opacity):
"""Blend the value before an adjustment with the value after it.
opacity runs from 0.0 (no effect) to 1.0 (full effect)."""
return before + (after - before) * opacity
before = 100
after = 160
for opacity in (0.0, 0.25, 0.5, 1.0):
print(opacity, apply_opacity(before, after, opacity))This gives 100, 115, 130, and 160. Opacity is the quickest way to tone down an adjustment that is right in character but too strong in degree. It is usually better than re-editing the curve, because you keep the shape you built.
Opacity and Fill
The Layers panel shows two sliders, Opacity and Fill. For adjustment layers they behave the same way, because an adjustment layer has no pixel content of its own for Fill to treat separately. Use Opacity. Fill matters for layers with layer styles, such as drop shadows, where it can reduce the pixels while leaving the style at full strength.
Opacity versus mask density
Opacity and mask density both reduce an effect, but they act differently.
| Control | Where it is set | What it changes |
|---|---|---|
| Layer opacity | Layers panel | Strength of the whole adjustment, everywhere |
| Mask density | Properties panel, Masks | Strength of the mask's black areas, so hidden regions let some effect through |
| Painted gray in the mask | Brush on the mask | Strength at specific pixels |
Use opacity when the whole adjustment is too strong. Use the mask when only some areas need less. Applying both at once is fine, and their effects multiply.
Blend modes on adjustment layers
A blend mode defines the math Photoshop uses to combine a layer with the result below it. Adjustment layers have the same blend mode menu as pixel layers. The default is Normal, which uses the adjusted values directly.
Changing the blend mode of an adjustment layer changes how its output combines with the layers beneath. This is useful because it lets one adjustment layer do a narrower job than its controls would otherwise allow.
Modes worth knowing for adjustments
| Blend mode | Effect on an adjustment layer | Typical use |
|---|---|---|
| Normal | Applies the full adjustment: tone, color, and everything else | Default behavior |
| Luminosity | Keeps only the brightness change, leaves hue and saturation of the layers below untouched | Contrast curves without color shifts |
| Color | Keeps only the hue and saturation change, leaves brightness untouched | Color tweaks that must not alter tone |
| Multiply | Darkens the image, never brightens | Quick density boost using a Curves or Levels layer |
| Screen | Brightens the image, never darkens | Lifting underexposed areas |
| Soft Light and Overlay | Adds contrast, with Overlay being stronger | Contrast layered on top of a neutral adjustment |
Why Luminosity matters for Curves
When you raise contrast with an S-curve on the composite RGB channel, the red, green, and blue values all change. Because they change by different amounts for different pixels, saturation and hue shift too. Bright colors often become more saturated and shadows can drift toward a color. This is a common surprise.
Setting the Curves layer to Luminosity mode applies the brightness change only. The color relationships of the layers below stay as they were. If you want the opposite, a boost in saturation without tonal change, set a Hue/Saturation layer to Color mode.
A related trick uses a different layer type. A Curves layer with no edits set to Multiply darkens an overexposed image, and the same layer set to Screen brightens an underexposed one. You can then tune the strength with opacity and shape the result with a mask. This is faster than building the equivalent curve by hand.
Groups: organizing and controlling several layers
When a stack grows, put related adjustments in a group. A group has its own opacity and blend mode, so you can scale or re-mode several layers as one unit. A mask on the group applies to everything inside it.
There is one gotcha. A new group uses the blend mode Pass Through. Pass Through lets the adjustment layers inside the group act on everything below the group, as if the group were not there. If you change the group's mode to Normal, Photoshop first builds the group's contents in isolation and then composites the result. An adjustment layer in an isolated group has no pixels beneath it inside the group, so it adjusts nothing. This is a frequent reason for "my adjustments stopped working after I grouped them."
Keep groups on Pass Through unless you intend to isolate them.
Isolating on purpose
Isolation is useful when you want an adjustment to affect only the layers inside a group, such as one subject built from several pixel layers. Place the pixel layers and the adjustment layers in a Normal-mode group. The adjustments then reach only the group's contents.
Common problems and how to diagnose them
- An adjustment seems to do nothing. Check that its layer is above the content you want to change, that the layer is visible, that its mask is not black over the area, and that it is not trapped in an isolated Normal-mode group.
- Colors look too saturated after a contrast curve. Set the Curves layer to Luminosity, or add a Hue/Saturation layer and lower saturation slightly.
- Highlights are blown out and cannot be recovered. Look for a Levels or Curves layer lower in the stack that clips the white point. Reduce its effect, or move the clipping adjustment above where the detail matters.
- The image looks different after reordering layers. This is expected, since the order changes what each layer receives. Compare by toggling visibility and recheck the histogram.
- A global tweak ruins one area. Mask that area on the layer that causes the problem. Adding a counter-adjustment on top compounds the issue.
Summary of the decision process
- Place layers in the order of the work: tone first, then color, then style.
- Reduce a too-strong adjustment with opacity.
- Limit an adjustment to a property with a blend mode: Luminosity for tone only, Color for color only.
- Limit an adjustment to a region with a mask.
- Group related layers, and leave the group on Pass Through unless you need isolation.
Exercise
You add an S-curve on the composite RGB channel to a portrait and the skin tones turn too orange and saturated. You want to keep the added contrast and remove the color shift without editing the curve. What two options do you have, and which keeps the layer fully intact at full strength?
Show answer
Set the Curves layer's blend mode to Luminosity. This applies only the brightness change and leaves hue and saturation as they were, and it keeps the curve at full strength. The other option is to lower the layer's opacity, but that reduces the contrast along with the color shift. A third option is adding a Hue/Saturation layer to lower saturation, which treats the symptom with a second layer. Luminosity is the one that keeps the curve at full strength and removes the cause.
Exercise
You put a Levels layer and a Curves layer into a new group, then switch the group's blend mode from Pass Through to Normal. The image suddenly looks unadjusted. Why, and what are two ways to fix it?
Show answer
Normal mode isolates the group. The adjustment layers inside it have no pixels beneath them within the group, so they have nothing to adjust, and the group composites an empty result over the image. Fix it by setting the group's blend mode back to Pass Through, or by moving the pixel layers you want adjusted into the group so the adjustments have content to act on.
Exercise
Using the functions from this chapter, an input value of 100 is changed to 160 by an adjustment layer. What value does the viewer see at 40% layer opacity?
Show answer
124. The result is before + (after - before) x opacity, which is 100 + 60 x 0.4 = 124.