How to use focus stacking to get impossibly sharp photos

focus stacking
Hillary Grigonis / Digital Trends
Adjusting aperture alone can only do so much to get sharp images with a wide depth of field — sometimes, getting both point A and point B tack sharp in one shot is about as possible as a flying pig. This is particularly true for macro photography. But just like high-dynamic-range composites use multiple exposures to capture an otherwise impossible range of light, there’s a photographic trick that can capture impossibly sharp images: Focus stacking. Focus stacking is both a shooting and an editing technique that works together to create a shot that’s much sharper than the one you could achieve in camera, and beyond a tripod and a copy of Adobe Photoshop, it doesn’t require any specialized gear.

Essentially, focus stacking can help you get a deeper depth of field without resorting to microscopic aperture sizes that can actually soften your image due to diffraction. It also allows you to maintain the blurred background of a large aperture, while keeping your subject completely in focus. In our sample photo, adjusting the aperture to get both rings sufficiently sharp resulted in losing the soft background. Focus stacking solved the problem in a matter of minutes. Here’s how you can achieve this effect for yourself.

What is focus stacking?

The technique plays with depth of field, which determines how much of the image is in focus. Focus stacking can be used in a number of different types of images, but the trick is most common for macro photography because getting up close creates a shallower depth of field (i.e., only a small portion of the image is sharp).

Focus stacking merges multiple photos together that were taken at different focus distances. In the most basic sense, one image will focus on the closest point of the subject, the next in the middle, and the next on the farthest point — although many more images may be used to fill in the gaps. When those photos are merged, the result is an image with a much deeper depth of field than the original. Focus stacking can be used if the scene is too dark for a narrow aperture, or when a narrow aperture still isn’t enough to achieve a sufficient depth of field.

Some Panasonic cameras, including the Lumix GH5, can even do focus stacking in camera using the same 4K Photo mode that allows photographers to adjust focus after the shot.

How to use focus stacking to get sharper shots

1. Choose your scene and stabilize the camera.

Focus stacking requires layering several images over each other — a task that’s much easier to do when your camera doesn’t move between frames. Ideally, once you’ve decided on your composition, you should set up a tripod to keep the camera in place. Any way you can keep the camera steady is fine, however — in our example, the camera was resting on a table.

Note that the editing process often requires slight crops, so compose the shot a little wider than you’d like so you can avoid cropping out any important areas of the image.

2. Set your exposure.

Any time you are merging photos together, you don’t want the exposure to change between shots (unless, of course, you are shooting HDR). Use manual exposure mode to keep the exposure consistent between shots. Merging the photos will be easier if you start with an aperture at least partially stopped down, to pull out as much depth of field as you initially can. Again, however, lighting and diffraction may limit this.

On the other hand, if you want to keep the background as soft as possible, use a wide aperture and rely solely on focus stacking to add the extra sharpness — just note you’ll need to take more photos at more focus points to do this. You should also avoid auto white balance, as it may shift slightly from one exposure to the next.

3. Focus on area No. 1 and shoot.

With your camera secure and the exposure set, change your focus area to single-point autofocus so you can choose where the camera sets the focus. Focus on the frontmost part of the subject and take a photo. If you’re comfortable with it, we recommend using manual focus and live view (where you can punch in on the preview image to check focus), which will give you even greater control.

4. Continue shooting, adjusting the focus each time.

Next, repeat the previous step, moving the focal point each time, until you have photos with every section sharp. The number of shots you’ll need to merge depends on the subject and your aperture settings. Take a look at the previous shot, determine where the sharpness falls off, then place your focal point so that the sharp area will overlap with the previous sharp area (or, in manual focus, simply continue rotating the focus ring by a small amount between frames). If you don’t overlap the sharp areas, your final image could have a sharpness that wanes in and out, so err on the side of taking too many photos rather than too few.

how to use focus stacking for sharper photos focusstackinglayers

5. Open and align in Photoshop.

Editing is where the magic happens — and merging those images isn’t as complicated as it sounds, thanks to a few automated tools. First, you need to open all the files as separate layers in Photoshop. The simplest way to do that is to go to File > Scripts > Load Files Into Stacks and choose your files in the pop-up window. Check the box that says to attempt to auto align images, since even with a tripod you can sometimes have slight offset between shots. (If you’re also using Adobe Lightroom, you can select all the images, right click, and choose to open all the files in Photoshop. In the dialog box for stack options, select the box that says to include all the open files.)

You should now have a stack of aligned images. Next, you’ll blend them together.

how to use focus stacking for sharper photos focusstackingalign

6. Merge.

There are multiple ways to merge your focus stack, an auto option —  which works most of the time — and a manual option that offers more control.

To let Photoshop automatically merge your images, go to Edit > Auto-Blend Layers. If you have slight white spaces on the edges you can check the box that says “content aware fill transparent images” or you can crop them later. Also check the box for seamless tones and colors and select the “stack images” option (not the panorama).  Click OK, wait for Photoshop to do it’s magic, and then voila! A sharp focus stack.

Sometimes, however, the auto option doesn’t cut it — as was this case in our example image. Because the bokeh in the background was created from an out-of-focus flame, it was different in every frame, creating what’s called ghosting where the images don’t perfectly line up. To correct this, you can manually choose which portions of each layer to include in the final shot, rather than using the automated option.

Make sure the layers are aligned so that the focal point that’s the closest to the camera is on top. Next, use the eraser tool on each layer to erase the areas that aren’t sharp in that photo but that are sharp in the next layer or layers. Then, move to the next layer and repeat. By selectively erasing portions of each layer, you can choose which portions of the image should remain sharp. If you get lost in all the layers, use the eye icon to remove other layers to see exactly what you are working on.

Once you’re happy with the results, you can merge the layers down into one file and continue with any other edits. To keep the colors consistent when exporting the file, check the boxes for SRGB and embed color profile, otherwise the image’s colors and exposure may appear a bit different when viewed on the web.


Focus stacking allows photographers to work around the limitations of depth of field and create images that would be impossible to capture otherwise. The technique is excellent for getting sharper macro shots but can also be used in other areas, including landscapes with a lot of range from foreground to background, where a small aperture may be undesirable due to diffraction. Focus stacking is an advanced technique, but thanks to modern tools, it is actually pretty easy to pull off if you don’t mind putting in a little time.


What does this button do? A quick guide to understanding your camera’s controls

Most DSLR cameras are user-friendly, but that doesn't mean you can make sense of every button on your own. Thankfully, our quick-hit guide will help you better acquaint yourself with your camera's operation.

Lost without Print Screen? Here's a few ways to take a screenshot on your Mac

Whether you prefer to use keyboard shortcuts or applications such as Grab and Preview, this guide will teach you how to take a screenshot on a Mac. Once you know how, you'll be able to capture images within seconds.

Here are 5 free alternatives to Photoshop for all your photo-editing needs

Photoshop is a capable program, but it's also expensive. Lucky for you, there are plenty of great alternatives out there that allow for a range of versatility, without requiring you to break into your bank account.
Home Theater

What is Netflix Roulette, and how exactly does it work?

For years, educated viewers have been using Netflix Roulette to broaden their horizons. The web app can help you find movies and shows you'd never think to watch! What exactly is it, though, and how do you use it? We explain.

18 Lightroom keyboard shortcuts you can actually remember

Keyboard shortcuts make quick work of sorting and even editing photos, but they're often tough to remember. Here are 18 of the most helpful Lightroom shortcuts, whether you intend to use them in MacOS or on your Windows-based PC.

6 pro tips for taking amazing portrait photos with the Huawei P10

To really show us what the P10's Leica camera and its Portrait mode can do, a pro-photographer taught us how to use it. We learned plenty. Here are the best tips for perfect portraits and selfies.
Product Review

The Moto Z3 Play packs a lot of juice with its included battery mod

Motorola’s latest phone is the mid-range Moto Z3 Play. It costs $500, so why wouldn’t you just get the OnePlus 6? The answer isn’t so simple. There’s a lot to like here, and the phone comes with a battery mod that extends its life…

Here’s how to unlock your phone automatically with Android Smart Lock

Tired of unlocking your smartphone with a PIN or passcode? Android Smart Lock unlocks it automatically using your location, face, and more. Here's how to set it up, and everything you need to know about it.

These point-and-shoot cameras make your smartphone pics look like cave paintings

If your smartphone camera just isn't giving you the results you're looking for, maybe it's time to step up your game. The latest and greatest point-and-shoot cameras offer large sensors, tough bodies, and long lenses - something no phone…
Emerging Tech

Can a gadget save you from the distraction of gadgets? We tried Foci

Foci is a biometric wearable that looks a lot like a bluetooth earpiece that you wear on your waist. Using tiny sensors to monitor your breathing patterns, Foci promises to help keep your mind on track.
Product Review

Putting on the grits with the Instant Pot pressure cooker

If you want to dip your toe into the low-temperature waters of sous vide, the Anova precision cooker is a good way to start. It has a robust app and an easy-to-use interface that just may convert you to a whole new way of cooking.

We tried all the latest and greatest smartphones to find the best of 2018

Smartphones are perhaps the most important and personal piece of tech on the planet. That’s why it’s important to pick the best phone for your individual needs. Here are the best smartphones you can buy.

Photo FOMO: Fujifilm ramen, KodakCoin DOA, and Nikon’s secret sensor lab

In the latest photo industry news, Fujifilm released a limited-run of Provia-branded instant noodles, Kodak's Kashminer is DOA, and Imaging Resource looks inside the "super-secret" sensor lab at Nikon.

Unlock your phone's hidden potential with these smartphone codes

Turns out cheat codes aren't just for video games; smartphones have hidden features built into them which you can access by punching in specific codes. Here are some of the most useful smartphone codes for Android and iOS.

Lost your router? Here's how to find its IP address to help track it down

Changing the login information for your router isn't always easy, that's why so many have that little card on the back. But in order to use it, you need to know where to go. Here's how to find the IP address of your router.

What is portrait mode? How tech helps smartphones capture a better you

Several years ago, portrait modes started showing up on phones and quickly became one of the most popular ways to capture selfies, profile pics, and more. But how does portrait mode work, and how much difference does it make?
Emerging Tech

The best drone photos from around the world

Most of today's drones come equipped with high-end cameras, which are quickly revolutionizing the world of aerial photography as we know it. Here are some of the best drone photos from around the world.

The top-selling digital photography book can be yours for free now

To celebrate their YouTube channel reaching a million subscribers, popular photography vloggers Tony and Chelsea Northrup have launched a limited-time free offer for their top-selling book.

Fujifilm announces ultra-wide 8-16mm f/2.8 and massive 200mm f/2 lenses

Two new premium lenses have joined Fujifilm's X Series, an ultra-wide zoom for landscapes and astrophotography and a fast telephoto prime for low-light sports and wildlife. At $2,000 and $6,000, both are decidedly made for professionals.

With flip-out lenses, the Vuze XR transforms from 360- to 180-degree VR camera

The Vuze XR is a compact, dual-lens camera with an integrated handle and a neat party trick: The back-to-back lenses can flip forward to transition from 360-degree two-dimensional video, to 180-degree three-dimensional video.

Here’s how to turn off camera shutter sound on your Android phone

That clicking shutter sound on your Android phone can get annoying if you like to take lots of pictures. Fortunately, you can disable it. We will walk you through how to turn off the camera shutter sound on your Android phone.

Ditch the smartphone, this is the camera you want in your pocket

Fujifilm's XF10 offers premium image quality in a portable form factor that may just be enough to get smartphone shooters to pick up a real camera. It's also Fujifilm's cheapest premium compact yet, at $500.