Glance at the summary firstThe summary from the end of the lesson, as a road map before you start reading.
Because in macro closing down the aperture spoils sharpness through diffraction, focus stacking combines frames focused at different depths at a middle aperture and takes the sharpest area of each frame; the focus step is kept a little shorter than the sharp zone, and the number of frames is roughly calculated from the subject's depth and confirmed with a test sequence. The sequence is shot with the focus ring, a rail or the camera's focus bracketing feature, and an edge margin is left in the framing for focus breathing. In the combination, halos, broken hairs and double lines from movement are checked by enlarging; when a hand or a face is stacked, movement and over-sharpened skin texture are considered separately.
Learning goal
You will be able to show a subject that doesn't fit within a single frame's depth of field sharp from front to back, by combining a sequence of frames focused at different depths. You will explain through diffraction why closing the aperture all the way down isn't the solution, and roughly calculate how many frames are needed by looking at the subject's depth and each frame's sharp zone. You will choose between turning the focus ring, sliding the camera forward on a rail and using the camera's own focus bracketing feature, and recognize how focus breathing changes magnification between frames. In the combination you will find the halos that appear at edges, the fine hairs that stay blurred and the double lines; you will apply the same method in landscape and product shooting, and be able to decide how skin is affected when a hand or a face is stacked.
The question
At the foot of the bridge's stone railing, a small ladybird sits on the tip of a leaf. Your friend from the club attaches their macro lens, gets right up close to the insect and presses the shutter. On the screen the insect's eyes are gleaming, but the back of the red shell on its back has softened, and its legs and the leaf's veins have turned into a blurred smudge. They close down the aperture a little; the sharp zone lengthens by a few millimeters. They close it all the way down; this time everything is a little sharper, but the whole photo is soft, as if shot through a thin veil.
Your friend puts the camera on the tripod and shoots twelve frames, moving the focus a little farther back in each one. In the combined result the insect is sharp from its eyes to the back edge of its shell. How does an insect become sharp from end to end? How do twelve blurred frames turn into a single sharp frame?
Context
In the aperture lesson you saw that depth of field increases as the opening gets smaller, but that at very narrow openings diffraction softens the photo (Lesson 8.2). In the special lenses lesson, too, we discussed that a macro lens can form small subjects on the sensor close to their real size (Lesson 12.9). These two collide in macro: as you get very close to the subject, depth of field drops to millimeters, and trying to extend it with the aperture spoils sharpness because of diffraction.
Focus stacking gets past this dead end another way. Instead of trying to make everything sharp in a single frame, it captures a different slice sharp in each frame and stacks these slices on top of each other in software. While in a panorama the angle of view widens and in HDR the light range, here what widens is sharpness. Although the technique is identified with macro, it is also often used in landscape and product shooting.
Simple explanation
Why isn't closing down the aperture enough?
In macro, depth of field is so shallow that while an insect's eyes are sharp, its back a few millimeters behind blurs. The first reflex is to close down the aperture, and up to a point it works. But as the opening narrows, light bends at the edges of the hole; this diffraction brings a softness that spreads across the whole frame. In macro this effect stands out earlier than in a landscape shot from a distance at the same aperture, because close-up shooting narrows the lens's effective opening even further.
In the end there is a trade-off: as the aperture is closed down, the sharp zone lengthens but sharpness itself decreases. Focus stacking removes this trade-off. The aperture is left at the middle values where the lens is sharpest; the job of spreading sharpness through depth is given not to a single frame but to a sequence of frames. Each frame carries a thin but truly sharp slice, and the combined image shows more detail than a single frame softened by diffraction.
How many frames, with what step?
Focus stacking is the technique of producing an image sharp from front to back by combining frames of the same subject focused at different depths and taking the sharpest area of each frame. The logic of the sequence is simple: you focus on the nearest point and shoot the first frame, then move the focus a little farther back and shoot another frame, and continue like this until you reach the farthest point of the subject.
The focus step is the distance by which the plane of focus is moved between two frames shot one after another. The step should be a little shorter than a frame's sharp zone so that neighboring frames overlap in sharpness; if the step is too large, a strip remains between two frames that no frame shows sharp, and a blurred band appears in the combined image. A rough calculation shows the way: if each frame's sharp zone is about two millimeters and the insect's depth is ten millimeters, at least five frames are needed; with an overlap margin this number rises to seven or eight. You find the exact number with a test frame: shoot the sequence, combine it, enlarge it, and if there is a blurred band, make the step smaller.
Exposure and white balance must stay fixed throughout the sequence, otherwise brightness and color fluctuate between frames. The camera stays on the tripod and the frames are taken with a remote release or a self-timer so that the camera's vibration doesn't shift the frames.
How do you move the focus?
There are three ways. You can carry the focus a little farther back in each frame by turning the focus ring very slightly by hand; this is the simplest method, but it is hard to keep the steps equal. You can put the camera on a rail and, without touching the focus, move the camera toward the subject millimeter by millimeter; in macro the most orderly result is often achieved this way.
Focus bracketing is a feature many cameras offer that shoots the sequence automatically, moving the focus by itself with a set step and number of frames. You set the starting point to the nearest detail, choose the step size and the number of frames, and press the shutter once. Which step value corresponds to how many millimeters varies from camera to camera; that is why in the first sequence you need to check the result by enlarging it.
When the focus ring is turned, a side effect appears. Focus breathing is the image's magnification also changing slightly as the focus distance changes, and the framing narrowing and widening a little from frame to frame. Stacking programs often correct this by resizing the frames, but a thin strip may remain at the edges that needs to be cropped. In a sequence shot with a rail, magnification also changes a little; leaving an edge margin in the framing helps with both methods.
What breaks in the combination?
The stacking program chooses the sharpest area in each frame and gathers them into a single image. This choice works flawlessly in most places, but leaves traces in some. A stacking artefact is an error the program produces while combining sharp areas: light or dark halos that appear around the edge of an object in front, fine hairs and antennae looking broken or faint, an edge being drawn twice. It is seen most often at edges where a near object overlaps a distant background, because there, an edge that is sharp in one frame spreads over the background as a blurred halo in the rest of the frames. You need to enlarge and inspect such places, and if needed mask that area by hand from a single frame.
Any subject that moves while the sequence is going on also leaves a trace. A leaf swaying in the wind or an insect that moves changes place during the sequence, and in the combined frame a leg can appear in two places. Insects move less in the cool morning hours; making a shield with a piece of card or your body to block the wind helps. Resorting to a method that would harm a living subject to keep it still is not an option; if it is moving, you need to make do with fewer frames or give up.
The technique isn't limited to macro. In a landscape with a flower in front and a mountain behind, there are situations where even the hyperfocal distance can't keep both sharp enough (Lesson 10.9); three frames focused on the foreground, the middle ground and the horizon are often enough. In product shooting, a watch's dial and the end of its strap, or a ring's stone and the back of its band, become sharp with the same method.
When a person's hand or face is stacked, two things need attention. A hand holding a ring moves slightly with breathing and with the pulse; halos and double lines form around the fingers. Resting the hand on a fixed surface and keeping the sequence short reduces this problem. Texture has its share too: stacking shows every pore and every fine line of skin at the same sharpness. On light skin redness and veins, on dark skin gray flakes from dryness and shine spots, look harsher than in a single frame. With the product staying sharp, having the skin appear in only one or two frames can give a result that looks more natural to the eye; which is wanted depends on the photo's purpose.
Visual evidence
You set up the camera on the tripod beside the leaf and make a shield with a piece of card to block the wind. You set the aperture to a middle value and fix exposure and white balance in manual mode. You bring the focus to the insect's eyes and start a twelve-frame sequence with the camera's focus bracketing feature.
In the first combination the insect's eyes, shell and legs are sharp, but there is a thin, blurred band in the middle of the shell: the step was too large. When you make the step smaller and raise the sequence to eighteen frames, the band disappears. Enlarging it, you notice a light halo around the antennae; when you mask that area by hand from a single frame in which the antennae are sharp, the halo goes. Behind the insect, the leaf's veins remain as a soft background, because you had ended the sequence at the insect's back edge.
Your friend rests their hand on the railing with their watch on their wrist and asks for a stack of the dial. The dial and the strap are sharp; the warm brown skin of their hand appears with a natural softness because it is in only two frames.
Common mistakes
Common mistakeClosing the aperture all the way down to make everything sharp in macro.
The sharp zone lengthens but diffraction softens the whole frame. The fix: leave the aperture at middle values and spread the depth with a sequence of frames.
Common mistakeKeeping the focus step larger than the sharp zone.
A blurred band remains between two frames. The fix: keep the step a little shorter than the sharp zone, and check by combining and enlarging.
Common mistakeAccepting the combined frame without enlarging it.
Halos and double lines at the edges show up in a large print. The fix: enlarge and inspect the edges, and mask the problem area from a single frame.
Summary
Because in macro closing down the aperture spoils sharpness through diffraction, focus stacking combines frames focused at different depths at a middle aperture and takes the sharpest area of each frame; the focus step is kept a little shorter than the sharp zone, and the number of frames is roughly calculated from the subject's depth and confirmed with a test sequence. The sequence is shot with the focus ring, a rail or the camera's focus bracketing feature, and an edge margin is left in the framing for focus breathing. In the combination, halos, broken hairs and double lines from movement are checked by enlarging; when a hand or a face is stacked, movement and over-sharpened skin texture are considered separately.
Mini assignment
In this assignment you will shoot and combine a sequence of a small subject with depth, on a tripod.
- Shoot a flower, an insect or a small object from macro distance in a single frame, once at a middle aperture and once at the smallest opening, and compare their sharpness by enlarging.
- Shoot the same subject at a middle aperture as a sequence, moving the focus from the nearest point to the farthest, and combine it.
- Shoot the sequence once with a large and once with a small step; compare whether there is a blurred band in the combined frame.
- In the combined frame, look for halos and double lines by enlarging the edges; fix one by masking it from a single frame. If there is a hand in the frame, note how the skin's texture and edges look.
Check yourself
- Can you explain why closing the aperture all the way down isn't the solution?
- Can you roughly calculate how many frames are needed from the subject's depth and the width of the sharp zone?
- Were you able to find and fix a stacking artefact in the combined frame, and if a hand was stacked, did you decide how the skin looks?
Glossary
| Term | Short definition |
|---|---|
| Focus stacking | Combining frames focused at different depths by taking their sharpest areas. |
| Focus step | The distance by which the plane of focus is moved between two frames shot one after another. |
| Focus bracketing | The camera shooting the sequence by moving the focus by itself with a set step and number of frames. |
| Focus breathing | The image's magnification and framing changing slightly as the focus distance changes. |
| Stacking artefact | Errors such as halos, broken hairs and double lines that form in the combination. |
Mini quiz
1. Why isn't closing the aperture all the way down always the solution in macro?
- A) Because it shortens the exposure time
- B) Because the whole frame softens through diffraction
- C) Because it reduces depth of field
- D) Because it increases focus breathing
2. In the combined frame there is a blurred band in the middle of the insect's shell. What is the most likely cause?
- A) The white balance changed
- B) The aperture is too open
- C) The camera isn't on a tripod
- D) The focus step was kept larger than the sharp zone
3. Each frame's sharp zone is about two millimeters, and the subject's depth is ten millimeters. With an overlap margin, which is a reasonable number of frames?
- A) Seven or eight frames
- B) Two frames
- C) Any number under five frames
- D) Forty frames
4. In a stack of a hand holding a ring, double lines appear around the fingers. Which is the most suitable solution?
- A) Closing the aperture all the way down
- B) Increasing the number of frames
- C) Resting the hand on a fixed surface and keeping the sequence short
- D) Setting the white balance to automatic
Answers
- B — At a very narrow opening light bends at the edges of the hole; while the sharp zone lengthens, sharpness decreases.
- D — If the step is large, a strip remains between two frames that no frame shows sharp.
- A — Covering ten millimeters with two-millimeter slices needs at least five frames; with overlap the number rises to seven or eight.
- C — Double lines come from movement between frames; supporting the hand and shortening the sequence reduces movement.
Summary card
- Don't close the aperture all the way down in macro; diffraction spoils sharpness.
- Shoot a sequence from nearest to farthest at a middle aperture.
- Keep the focus step a little shorter than the sharp zone; leave no blurred band.
- Leave an edge margin in the framing for focus breathing.
- Look for halos, broken hairs and double lines by enlarging; on hands and faces, consider movement and skin texture separately.
Bridge to the next lesson
When the ladybird's sequence was finished, your friend raised their head and looked at the valley. Clouds coming from the west were flowing over the hills, their shadows sliding along the slopes, brightening and darkening over the town by turns. A single frame froze this flow, and a long exposure turned it into a soft smudge; as for a video lasting hours, no one would watch it from start to finish. How do you show the movement of clouds? The next lesson tells about the timelapse technique, which combines frames shot at set intervals and fits hours into seconds.