Sub topic 13
Matching haze and depth of field
This chapter assumes you can build a non-destructive stack (Smart Objects, adjustment layers, clipping masks, layer masks) and that you have already matched tone and colour in the earlier chapters. Here you add the last two depth cues: how much air sits between the camera and the subject, and how much of the scene the lens holds in focus.
Why depth cues expose a composite
A pasted element is often sharp, contrasty and fully saturated. A real object 200 metres away is none of those things. Air scatters light, so distant objects lose contrast and take on the colour of the atmosphere. The lens also keeps only one distance sharp, and everything else softens in proportion to how far it is from that distance.
If your element ignores both effects, the viewer sees it as sitting on top of the photo instead of in it. Fixing this takes two controls: a haze layer and a blur whose strength depends on distance.
Reading the haze in the plate
Haze, also called aerial perspective, changes four things as distance grows:
| Property | What happens with distance |
|---|---|
| Contrast | Drops. The gap between darkest and lightest shrinks. |
| Black point | Rises. Deep blacks turn dark grey. |
| Saturation | Falls toward the atmosphere's colour. |
| Hue | Shifts toward the colour of the sky or fog near the horizon. |
Before you touch the element, study the plate. Find two objects of similar tone at different distances, such as two ridgelines, two buildings or two cars. Compare their darkest areas with the Color Sampler tool (nested under the Eyedropper tool). Place a sampler on each and read the values in the Info panel (F8). The far object's shadows will be lighter and will lean toward the sky colour. These numbers tell you how strong the haze is, so you don't have to judge it by eye alone.
Also note the haze colour. Sample the sky just above the horizon. That colour, not pure grey or pure blue, is what your element should drift toward.
Building a haze layer
Build haze as a separate, editable layer, clipped to the element. There are two common approaches, and they work well together.
Lifting the black point
- Add a Levels adjustment layer above the element and clip it (Alt/Option-click between the layers).
- Drag the black Output Levels slider (the bottom gradient bar) to the right. Start with a value of 10 to 30.
- Pull the white Output slider in slightly if the plate's highlights are also dimmer at distance.
This compresses the tonal range, which is what real haze does. It affects contrast and brightness, but it adds no colour.
Adding atmosphere colour
- Add a Solid Color or Color Fill layer above the Levels layer, filled with the sampled horizon colour, and clip it to the element.
- Set the blend mode to Normal and lower the opacity to between 5% and 25%. Alternatively, use a Photo Filter adjustment with the same colour and a density in the same range.
- Reduce saturation with a clipped Hue/Saturation layer, usually by 5 to 20 points.
Keep every one of these layers clipped. Then the haze affects only the element, and you can move or delete it freely.
Haze that depends on position
A single flat haze layer is correct only if the whole element sits at one distance. A tall tree or a building receding in perspective has a near edge and a far edge. For these, add a layer mask to the colour fill and paint a gradient (G) on it so the haze is stronger on the far side. Use a long, soft gradient. A hard transition looks like a stripe of fog.
Matching depth of field
Depth of field is the range of distances that look acceptably sharp. Blur increases gradually on both sides of the focal plane, so a single Gaussian Blur applied to the whole element is rarely enough. Work out where the focus sits first.
Finding the focal plane
Zoom to 100% and look for the sharpest detail in the plate: fine texture, crisp edges, readable text. That is the focal plane. Then check objects in front of it and behind it. Their blur should increase with distance from that plane, in both directions.
You now have one of three cases for your element:
- It sits on the focal plane. Leave it sharp, and check only that its sharpness matches nearby real objects.
- It sits behind the focal plane. Blur it, and make the blur match real objects at the same distance.
- It sits in front of the focal plane. It is also blurred, and the blur is usually larger than you expect. Foreground blur is a common thing to forget.
Applying blur non-destructively
Convert the element to a Smart Object first, then apply the blur from the Filter menu. Smart Filters stay editable and carry their own mask.
- Right-click the layer and choose Convert to Smart Object.
- Choose Filter > Blur > Gaussian Blur for a simple match. Start with a radius near 1 to 3 px for a mild difference and raise it until the edges match nearby objects in the plate.
- Compare at 100% zoom, not on a fitted view. Blur is easy to over-apply when zoomed out.
For a more lens-like result, use Filter > Blur > Lens Blur. It simulates an aperture, so bright points of light bloom into soft discs (bokeh) instead of dissolving into a smear. In the Lens Blur dialog you can set the Depth Map source to Layer Mask or Transparency. A grayscale mask then controls where blur is strong (white or black, depending on the Focal Distance setting) and where it is weak.
Varying blur across the element
For an element that spans several distances, paint the blur strength with the Smart Filter mask or a depth map:
- Draw a gradient from black (in focus) to white (maximum blur) along the direction of receding distance.
- Use that gradient as the Lens Blur depth map.
- Adjust the Blur Focal Distance slider until the sharp part lines up with the plate's focal plane.
If you prefer to work directly, Filter > Blur Gallery offers Field Blur, Iris Blur and Tilt-Shift. Tilt-Shift suits a ground plane that recedes in a straight band.
Edge cases and common errors
Halos around blurred edges. When you blur a cut-out, its edge pixels blend with transparency and can leave a pale or dark fringe against the plate. Contract the mask by 1 px, or apply the blur before refining the mask edge. Check the result on a copy of the layer first.
Blurring the mask but not the shadow. A contact shadow that stays razor sharp under a blurred element gives the trick away. Blur the shadow by an equal or slightly larger amount. Shadows soften further from the object.
Haze that ignores the light. Haze is lit like everything else. In a warm sunset plate, haze near the horizon is warm and bright, not cool grey. Use the sampled colour, not a default.
Over-blurring. If the element is noticeably softer than real objects at the same distance, the eye reads it as a different photo. Match the plate, not your idea of "background".
Sharp texture inside soft edges. If you blur edges but leave interior texture crisp (hair, fabric, bark), the element looks cut-out. Blur the whole Smart Object, not only the mask.
Order of operations
Apply tonal and colour matching first, then haze, then blur, and add grain and sharpening last (the next chapter). Grain applied before blur gets smoothed away, and grain applied to only part of the image gives the element a different texture from its surroundings.
Exercise
A tree you are compositing into a landscape sits well behind the plate's focal plane, near some distant hills. Its shadows are deep black and its leaves are highly saturated. Which clipped adjustments do you add, and in what order, to match the haze and depth of field?
Show answer
First sample the hills' shadows and the horizon sky colour with the Color Sampler. Add a clipped Levels layer and raise the black Output slider (about 10 to 30) so the tree's shadows match the hills' lifted blacks. Add a clipped Color Fill layer in the sampled horizon colour at 5% to 25% opacity, and a clipped Hue/Saturation layer lowering saturation by 5 to 20 points. Convert the tree to a Smart Object and apply Lens Blur (or Gaussian Blur) with a radius that matches the hills' edge softness, checking at 100% zoom. If the tree is tall, mask the haze with a gradient so its far parts get more haze.
Exercise
You blurred a car that sits in front of the focal plane, but its contact shadow is still sharp. What is wrong, and how do you fix it?
Show answer
Blur strength depends on distance from the focal plane, and the shadow lies on the ground at the same distance as the car, so it must be blurred as well. Convert the shadow layer to a Smart Object and apply a blur equal to or slightly larger than the car's, since shadows soften as they spread away from the object.