PHOT-330 · Lesson 4 of 12 · 30 min
Depth of field, hyperfocal distance and focus stacking
Many landscape photographs need sharpness from a few centimeters in front of the lens to the distant horizon. A flower in the foreground and a mountain on the skyline should both look crisp. Depth of field, the range of distances that look acceptably sharp, is the key concept. This lesson revisits depth of field with landscape needs in mind, explains the hyperfocal distance and how to use it, discusses diffraction and why stopping down to f/22 is often a mistake, and teaches focus stacking, the technique professionals use when no single aperture can give enough depth. PHOT-201 introduced aperture and depth of field; here we add the calculations and field methods.
What “acceptably sharp” means
Strictly, a lens focuses perfectly at only one distance. Points nearer or farther form small blur circles on the sensor. If those circles are smaller than the eye can distinguish in the final print or screen view, the image looks sharp. The largest acceptable blur circle is called the circle of confusion, \( c \). A traditional value for full-frame sensors is 0.03 mm, based on an 8 × 10 inch print viewed at about 25 cm; for very large prints or close inspection on high-resolution screens, photographers often use a stricter value such as 0.02 mm or less. For APS-C sensors, divide by the crop factor, giving about 0.02 mm.
Depth of field therefore depends not only on aperture, focal length and focus distance, but also on how large the image will be displayed and how closely it will be viewed. A landscape that looks sharp on a phone may look soft in a 1-meter print.
The hyperfocal distance
For any focal length, aperture and circle of confusion, there is a focus distance called the hyperfocal distance, \( H \). When the lens is focused at \( H \), everything from about \( H/2 \) to infinity is acceptably sharp. Focusing anywhere nearer than \( H \) loses infinity; focusing farther wastes near depth. The formula is:
where \( f \) is focal length, \( N \) the f-number and \( c \) the circle of confusion, all in the same units (usually millimeters). The \( + f \) term is tiny for landscape lenses and often dropped.
Worked problem
Hyperfocal distance for a wide lens
A photographer uses a 20 mm lens at f/11 on a full-frame camera with c = 0.03 mm. Find the hyperfocal distance and the near limit of sharpness when focused there.
Show solution
- \( f^2 = 400 \) mm².
- \( N c = 11 \times 0.03 = 0.33 \) mm.
- \( H = 400 / 0.33 + 20 ≈ 1{,}212 + 20 = 1{,}232 \) mm ≈ 1.23 m (about 4 ft).
- Near limit: \( H/2 ≈ 0.62 \) m (about 2 ft).
Answer: Focus at about 1.2 m and everything from about 0.6 m to infinity is acceptably sharp at c = 0.03 mm. For a large print with c = 0.02 mm, H becomes about 1.8 m and the near limit about 0.9 m.
Look at how strongly focal length matters: hyperfocal distance grows with the square of focal length. At f/11, a 50 mm lens has \( H \) of about 7.6 m, and a 100 mm lens about 30 m. That is why wide-angle lenses are the natural tools for near-to-far landscapes.
| Focal length | f/8 | f/11 | f/16 |
|---|---|---|---|
| 16 mm | 1.1 m | 0.79 m | 0.55 m |
| 24 mm | 2.4 m | 1.8 m | 1.2 m |
| 35 mm | 5.1 m | 3.7 m | 2.6 m |
| 50 mm | 10.5 m | 7.6 m | 5.3 m |
Near and far limits for any focus distance
When focused at a distance \( s \), the near and far limits of acceptable sharpness are approximately:
If \( s \) is equal to or greater than \( H \), the far limit is infinity.
Worked problem
Focusing on the foreground instead
With the same 20 mm lens at f/11 (H ≈ 1.23 m), the photographer focuses on a flower 0.5 m away. What is the range of sharpness?
Show solution
- Near limit: \( D_n = 1.23 \times 0.5 / (1.23 + 0.5) = 0.615 / 1.73 ≈ 0.36 \) m.
- Far limit: \( D_f = 1.23 \times 0.5 / (1.23 − 0.5) = 0.615 / 0.73 ≈ 0.84 \) m.
Answer: Only about 0.36 to 0.84 m is sharp; the mountains will be soft. Focusing on the nearest object is a common landscape mistake. To keep the flower at 0.5 m sharp along with infinity, the hyperfocal distance would need to be about 1.0 m or less (so H/2 ≤ 0.5 m), which needs about f/14 or smaller at 20 mm, or focus stacking.
Diffraction: why f/22 is not the answer
It might seem that stopping down to the smallest aperture solves every depth problem. But light passing through a small aperture spreads out, an effect called diffraction, which softens the whole image. The size of the diffraction blur, the Airy disk, grows with the f-number. Its diameter is approximately:
where \( \lambda \) is the wavelength of light. For green light (about 0.00055 mm), this gives about 0.0013 mm × N.
Worked problem
Diffraction against pixel size
A 45-megapixel full-frame camera has a pixel pitch of about 4.4 µm. Compare the Airy disk diameter at f/8, f/11, f/16 and f/22.
Show solution
- At f/8: 2.44 × 0.55 µm × 8 ≈ 10.7 µm, about 2.4 pixels.
- At f/11: ≈ 14.8 µm, about 3.4 pixels.
- At f/16: ≈ 21.5 µm, about 4.9 pixels.
- At f/22: ≈ 29.5 µm, about 6.7 pixels.
Answer: From about f/11 onward, diffraction blur spans several pixels, and by f/22 the whole image is visibly softer at full resolution. Many landscape photographers on high-resolution cameras work at f/8 to f/11 and use focus stacking rather than f/22 when they need more depth.
Diffraction does not make small apertures useless. At web sizes, f/16 or f/22 may look fine, and sometimes the extra depth or a longer exposure is worth a little softness. The point is to know the trade-off.
Field methods for focusing
In the field, few photographers calculate hyperfocal distances for every shot. Practical methods include:
- Double-the-distance method. Find the nearest object you need sharp, and focus at roughly twice that distance. At an aperture where the hyperfocal distance is near that focus point, near to infinity will be close to sharp. Then check.
- Apps and tables. Depth-of-field apps or a printed table for your favorite lenses give hyperfocal values quickly.
- Magnified live view. Focus manually using the camera's magnified view, then check the near foreground and distant horizon at maximum magnification before shooting.
- Test and review. Take a frame, magnify it on the camera screen and check both extremes. If either is soft, refocus, change aperture or switch to focus stacking.
Autofocus is unreliable for this kind of placement because it focuses on whatever is under the focus point. Most landscape photographers switch to manual focus or back-button focus once the focus is set, so the camera does not refocus when the shutter is pressed.
Focus stacking
When the nearest subject is very close, when using a longer lens, or when you want maximum sharpness at an optimal aperture, a single frame cannot do the job. Focus stacking means taking several frames at different focus distances, from near to far, and blending the sharpest parts of each in software. It is standard in macro photography (Lesson 9) and widely used in landscapes.
The steps are: mount the camera on a solid tripod; compose; set manual exposure so all frames match; choose an aperture near the lens's sharpest, often f/8; focus on the nearest point and take a frame; refocus slightly farther and take another; continue until the farthest point is sharp. Successive frames must overlap in their zones of sharpness. Some cameras can shoot a focus bracket automatically, stepping focus between frames.
How many frames are needed? One simple approach uses the near and far limits. Starting with focus at the nearest point, each next frame is focused so that its near limit sits at or just inside the previous frame's far limit, with some margin.
Worked problem
Planning a landscape focus stack
A photographer with a 24 mm lens at f/8 (H ≈ 2.4 m) needs sharpness from a lichen-covered rock at 0.3 m to the distant peaks. How many frames are needed, without margin?
Show solution
- Frame 1: focus at 0.3 m. Far limit \( D_f = 2.4 \times 0.3 / (2.4 − 0.3) = 0.72 / 2.1 ≈ 0.34 \) m.
- Frame 2: choose \( s \) so the near limit is 0.34 m. Near limit \( Hs/(H+s) = 0.34 \) gives \( s = 0.34H/(H − 0.34) = 0.816 / 2.06 ≈ 0.40 \) m. Far limit \( = 2.4 \times 0.40 / 2.0 ≈ 0.48 \) m.
- Frame 3: near limit 0.48 m gives \( s = 0.48 \times 2.4 / 1.92 = 0.60 \) m; far limit \( = 1.44 / 1.80 = 0.80 \) m.
- Frame 4: near 0.80 m gives \( s = 1.92 / 1.60 = 1.20 \) m; far limit \( = 2.88 / 1.20 = 2.4 \) m.
- Frame 5: near 2.4 m gives \( s ≥ H \), so focus at about 4.8 m or beyond and the far limit is infinity.
Answer: About five frames, or six or seven with a safety margin. The steps get larger with distance: most of the work is close to the camera. In practice, photographers often take a few extra frames and let the software choose.
Stacking has limitations. Moving subjects, such as grass in wind, waves or clouds, appear in different positions in each frame and produce blending artifacts. Changes in focus also change the image size slightly, called focus breathing, which software must correct. Shoot quickly when anything is moving, and retouch artifacts afterwards.
Focus breathing and alignment
Many lenses change their effective focal length slightly as they focus, so near-focused frames look a little larger or smaller than far-focused ones. Stacking software aligns and scales the frames before blending. A sturdy tripod, a remote release and avoiding touching the camera between frames, other than to adjust focus, help alignment. Some photographers use a focusing rail for macro work, moving the whole camera rather than refocusing the lens, which avoids breathing but changes perspective slightly.
Tilt lenses as an alternative
Tilt-shift lenses, introduced in PHOT-311 for architecture, can also extend apparent depth of field in landscapes. Tilting the lens tilts the plane of sharp focus, so it can run from a foreground near the camera to a distant horizon, following the Scheimpflug principle. This allows a wide aperture, avoiding diffraction, and works in a single frame, so moving subjects are not a problem. The limitation is that the zone of sharpness becomes a wedge: objects that rise far above or below the tilted plane, such as tall trees in the foreground, may fall outside it.
Depth of field as a creative tool
Not every nature image needs everything sharp. A shallow depth of field isolates a flower, an animal or a pattern from a busy background and can soften foreground leaves into a wash of color. Wildlife photographers often shoot wide open to separate the animal from the background, as Lesson 8 explains. The key is to choose depth of field deliberately rather than accept whatever happens.
Common mistakes
MistakeFocusing on the nearest object and assuming the background will be sharp.
InsteadUse the hyperfocal distance or focus stacking, and check both extremes.
MistakeStopping down to f/22 for every landscape.
InsteadWork at f/8 to f/11 on high-resolution cameras and stack when more depth is needed.
MistakeUsing a circle of confusion meant for small prints for a large exhibition print.
InsteadChoose a stricter circle of confusion for large or closely viewed prints.
MistakeLetting autofocus refocus each time the shutter is pressed.
InsteadSet focus manually or use back-button focus.
MistakeFocus stacking scenes with fast-moving grass or water without a plan.
InsteadShoot quickly, consider fewer frames or a tilt lens, and retouch artifacts.
Summary and key terms
- Depth of field depends on aperture, focal length, focus distance and the chosen circle of confusion.
- Hyperfocal distance \( H = f^2/(Nc) + f \); focusing at \( H \) gives sharpness from \( H/2 \) to infinity.
- Near and far limits are \( Hs/(H+s) \) and \( Hs/(H-s) \).
- Diffraction blur \( ≈ 2.44 \lambda N \) grows with f-number and softens images beyond about f/11 on high-resolution sensors.
- Check focus with magnified live view; avoid autofocus refocusing.
- Focus stacking blends several frames focused at different distances; steps grow with distance.
- Tilt lenses tilt the plane of focus and can replace stacking for some scenes.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Hyperfocal distance for a 16 mm lens at f/8 with c = 0.03 mm?
Show answer
256 / 0.24 + 16 ≈ 1,083 mm ≈ 1.1 m.
Near limit when focused there?
Show answer
About 0.55 m.
Hyperfocal distance for 35 mm at f/11, c = 0.03 mm?
Show answer
1,225 / 0.33 + 35 ≈ 3,747 mm ≈ 3.7 m.
How does doubling the focal length change H?
Show answer
It roughly quadruples H.
Near and far limits for H = 3 m focused at 1.5 m?
Show answer
Near 4.5/4.5 = 1.0 m; far 4.5/1.5 = 3.0 m.
Airy disk at f/16 in micrometers?
Show answer
2.44 × 0.55 × 16 ≈ 21.5 µm.
Why work at f/8 to f/11 on a 45-megapixel camera?
Show answer
To balance depth of field against diffraction softening.
What is focus breathing?
Show answer
A change in image size as focus changes.
Why do focus stack steps get larger with distance?
Show answer
Depth of field increases rapidly as focus distance increases.
Name one advantage of a tilt lens over stacking.
Show answer
It works in a single frame, so moving subjects are not a problem.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.