Skip to main content

The Ultimate Guide to Learning Photography: Focus Stacking

What is focus stacking? Try this simple technique for sharper shots

Digital cameras are powerful tools — over the past few years, they’ve added megapixels while shedding weight and dramatically improving low light performance. But, there’s still only so much you can do with a single photograph. Focus stacking enters the arena alongside high dynamic range as a photo editing trick that uses multiple images to achieve what’s impossible with a single photograph.

So what is focus stacking and how do you use it? Focus stacking merges several photos taken at different focal points to achieve a depth of field that’s either impossible because of the gear on hand, difficult because of the light that’s available or otherwise unworkable because of depth of field parameters. While the technique is a bit more complex than shooting and editing a single image, with a tripod and a few tricks, focus stacking can keep all the details in focus.

What is focus stacking?

A distant relative of high dynamic range, focus stacking layers images taken at multiple focus points instead of different exposures. The result is an image that’s sharper than any of the original photos by themselves.

So why focus stacking? Focus stacking tackles depth of field problems, or how much of the image is in focus. Depending on the aperture settings and how close the camera is to the subject, the objects in the photo may be several feet apart and still in focus, or they may be millimeters apart and out-of-focus.

Shooting up close to a subject, like in macro photography, creates a very narrow depth of field — so narrow, in fact, that a bumble bee’s antennae may be in focus, but his stinger is blurred into the background. While using a wider aperture can help, often, aperture alone isn’t enough to add that detail back in. By capturing the subject in a series of images instead, those details can be layered back in.

While macro photography is one of the biggest reasons to use the focus stacking technique, it’s not the only reason. A wide aperture will let in a lot of light, but leaves most of the image out of focus. If you are shooting a landscape at night, focus stacking will create the look of a wider aperture, even though it wasn’t possible to use one.

Focus stacking is also occasionally used in landscape photography, often when there’s an element in the foreground that, even with a large aperture, would still be out of focus.

Whatever the subject is, focus stacking works to capture a sharper image than the camera can capture with a single shot.

How to shoot a series of photos for focus stacking

— Photo: Casey Cosley

To get that sharp final image, you need to shoot a series of photos with a different focal point in each one. First, pick your scene and frame up your composition. Ideally, you should use a tripod. While software is now able to align the images automatically, with the auto align method, you lose resolution since you’ll need to crop off the edges that didn’t quite overlap. If bringing a tripod isn’t possible, keep your composition as close as possible throughout the series.

A focus stack is best shot in manual mode so that the exposure is uniform across all the images in the series. (If you’re not yet comfortable in manual mode, turn the camera to programmed auto, and take note of those settings. Then, go back to manual and use those same settings). Occasionally, focus stacking is done with varying apertures to merge images with a different depth of field, but for simplicity’s sake, stick with manual mode and an even exposure until you’re more experienced with focus stacking.

Next, identify how much of the image you would like to keep in focus. Perhaps you have a row of three trees, for example, and you want all three trees to remain in focus, or maybe you’re shooting a close-up of a flower and you’d like every petal to be tack sharp.

The tricky part of focus stacking is determining how many images you need to take to get the level of sharpness that you’re envisioning. The more images you stack together, the sharper the image will be — but the trickier it will be to shoot it all. The closer you are to a subject, and the wider your aperture is, the more images you’ll need to shoot.

In that row of three trees, for example, shooting three images, one focused on each tree is a simple way to stack focus. That flower, however, may need more images, since depth of field changes dramatically with distance.

How do you decide how many images to shoot? Try first taking a test shot focusing on the front edge of the closest object you’d like to remain sharp. Then, take a look at that test shot in the preview on the LCD screen (don’t forget to use the zoom button). How quickly does that sharpness fall off? If that flower is still sharp one third of the way through, you can get away with three to four shots. If that flower is only sharp for the first tenth of that blossom, however, you’ll want to use more than ten images. You want to avoid gaps, or sharpness will fall away then return, fall away and then return. Focus stacking takes some practice, so if you’re not sure, taking multiple sets to experiment with later.

Once you’ve determined what you need to remain in focus and how many shots you’ll need to get there, start shooting. Put the focal point on the first point and shoot. Move the point deeper into the photograph and shoot again. Continue shooting, moving the focal point deeper with each photo, until you’ve captured the entire range.

How to create a single image from focus stacking in Photoshop

While focus stacking used to involve manually blending each sharp area together into one photograph, with the latest version of Photoshop (and even variations back to 2014), the program can automatically blend a stacked image for simple focus stack editing.

Start in Photoshop by going into File > Scripts > Load Files Into Stack. In the dialog box that opens, select all the photos in the series by clicking browse. Leave the other options unchecked. Now, your photos will automatically be loaded into separate layers.

Next, make sure your photos are perfectly aligned. Highlight each layer in the layers panel, then go up into Edit from the top toolbar and choose Auto-Align Layers. The Auto option does a good job most of the time, but for more accuracy, choose “collage” for a focus stack, then press okay.

If you didn’t use a tripod, your layers likely don’t quite meet up — use the crop tool to create a uniform image by cropping off any areas that don’t overlap with all of the layers. Occasionally, you may still have some crop when using a tripod, particularly if it was windy.

Next, you need to tell Photoshop that you want all of those layers to merge into one image, but one image that keeps the sharpness from the series. To do that, with all those layers still selected, head into Edit > Auto-Blend Layers. Make sure “Stack Images” is selected, then hit okay.

Photoshop will now work it’s magic and blend all those focal points — the “magic” may take a few minutes. Once the process is complete, you should see a sharp image, and over in the layers box, masks showing which part of which layer is visible in the final image. If you need to tweak what part of the each photo is included, you can do so by editing that layer’s mask.

Now that the series of images is merged, you can flatten the image (Layers > Flatten Image) and then edit the photo just like you would with a single shot.

Photoshop is just one way to merge a focus stack, several photo editors can handle the task and there are even programs dedicated entirely to focus stacking, like Helicon Focus and Zerene Stacker.

Focus stacking defies the limitations of photography and creates a single image that isn’t possible from one press of the shutter release. By merging multiple photos together at different focal points, you can overcome the limitations of your gear, combat low lighting or create dramatically sharp macro photographs. Focus stacking may be more complex than a single shot, but in many scenarios, the extra shooting — and extra editing — is well worth the effort.