What Is Focus Stacking and How to Do It in Photoshop
Focus stacking is a digital photography technique that combines several images made at different focus distances into one photograph with an extended depth of field. Instead of forcing a single exposure to keep every part of a scene sharp, the photographer captures a sequence of frames and uses software to merge the sharp areas.
The method is especially valuable in macro photography, product photography, landscape work, architecture, and still life. At close focusing distances, even a narrow aperture may leave part of a flower, insect, watch, or small object outside the zone of acceptable sharpness. Stacking solves that limitation by distributing focus across multiple exposures.
Adobe Photoshop includes the essential tools for this process: layer alignment and automatic blend layers. The quality of the result depends on both the source photographs and the way the merged file is inspected afterward. Careful camera technique matters just as much as the software.
What Focus Stacking Achieves
Depth of field is the area in front of and behind the focus point that appears acceptably sharp. It becomes shallower as magnification increases, the subject moves closer to the lens, or a wider aperture is used. Stopping down can increase depth of field, but very small apertures introduce diffraction, which reduces fine detail across the frame.
A focus stack uses several exposures, with each frame focused on a different part of the subject. Photoshop identifies the sharp regions and combines them into a composite image. The final result can show a front edge, central detail, and background structure clearly, even when no single photograph could record all of them at once.
This technique does not increase the optical resolution of a lens, and it cannot repair motion blur or missed focus. It is a way to manage depth of field, not a replacement for good optics or precise focusing. The scene must remain sufficiently stable while the sequence is captured.
Capture A Consistent Image Sequence
Begin by placing the camera on a sturdy tripod. Turn off image stabilization when the camera and lens are firmly mounted, and use a remote release or a short self-timer to reduce vibration. Manual exposure is preferable because brightness, shutter speed, and color should remain consistent throughout the sequence.
Set the aperture near the lens’s sharpest range rather than automatically choosing the smallest available aperture. Many lenses perform well around f/5.6 to f/11, although the ideal setting depends on the lens, subject size, and desired rendering. Use a low enough ISO to preserve detail, while remembering that a controlled increase in ISO may be preferable to an exposure that risks movement.
For a deeper look at how sensor behavior affects exposure decisions, this ISO invariance guide provides useful context. ISO selection is particularly relevant when a stack involves long exposures, dark backgrounds, or substantial shadow recovery.
Focus manually or use single-point autofocus for the first frame, then change the focus distance in small, predictable increments. Start with the nearest important detail and progress toward the farthest one. Capture extra frames so there are no gaps between sharp zones. A slightly overlapping sequence is easier for Photoshop to blend than a minimal series with missing focus coverage.
Prepare Files Before Blending
Import the photographs into Lightroom, Adobe Camera Raw, or another raw processor and apply consistent corrections to every frame. White balance, exposure, lens corrections, chromatic aberration removal, and basic color adjustments should match across the sequence. Avoid making independent edits that cause brightness or color shifts from one image to the next.
Exporting processed files as 16-bit TIFFs can preserve more tonal information than heavily compressed JPEGs. Photoshop can also open raw files as separate layers, but converting the images first gives you a chance to synchronize corrections and organize the sequence. Keep the original raw files so that the stack can be rebuilt if the blend reveals a problem.
Open Photoshop and load the images into one document as layers. The simplest route is File > Scripts > Load Files into Stack. Select the sequence and enable the option to attempt automatic alignment of source images. If you have already opened the files, place each one on its own layer and arrange them in focus order.
Before blending, check the document for major differences in framing. Automatic alignment can correct small shifts caused by slight tripod movement, but it cannot fully solve a change in perspective from camera movement. Crop away empty edges after alignment if the layers no longer share the same boundaries.
Blend Layers In Photoshop
Select all of the image layers in the Layers panel. Choose Edit > Auto-Align Layers, select Auto as the projection method, and allow Photoshop to analyze the sequence. This step is important even when the camera was on a tripod because focus breathing can subtly change the apparent size and framing of the subject as the focus distance changes.
Once alignment is complete, select the aligned layers again and choose Edit > Auto-Blend Layers. In the dialog box, choose Stack Images and enable Seamless Tones and Colors. Photoshop creates layer masks that retain the sharp sections from the individual frames while concealing areas that are less focused.
The automatic composite often produces an excellent first result, but it should be treated as a starting point. Zoom to 100 percent and inspect the foreground, subject edges, fine textures, and background transitions. Look for halos, repeated details, transparent gaps, or sections that appear unexpectedly soft.
| Approach |
Strengths |
Limitations |
Best Use |
| Single exposure at a moderate aperture |
Fast and simple; natural movement rendering |
Limited depth of field; diffraction may reduce detail |
Casual scenes and subjects with little depth |
| Small aperture single exposure |
Maximum depth of field from one frame |
Diffraction, longer shutter speeds, and possible loss of fine detail |
Static subjects with modest depth |
| Photoshop focus stack |
Greater depth of field with lens-level detail |
Requires multiple exposures and a stable subject |
Macro, product, still life, and landscape details |
| Dedicated stacking software |
Advanced masking and retouching controls |
Additional cost and a separate workflow |
Complex stacks or frequent professional use |
Correct Masks And Blending Errors
Photoshop’s generated masks can be edited manually. Select a layer mask and paint with a soft white brush to reveal that layer or black to hide it. Use a low brush opacity for gradual transitions, and work at a high zoom level around edges where the software may have selected the wrong frame.
Common artifacts include bright outlines along a subject, dark seams between layers, and duplicated textures. These often occur when the subject moved slightly, when the lens changed magnification during focusing, or when the background contains repeating patterns. The Clone Stamp and Healing Brush can help repair small areas after the layer masks are corrected.
Movement is the most difficult problem. Leaves, insects, water, clouds, and fabric can shift between frames, producing ghosting when Photoshop combines them. For small moving elements, choose the cleanest frame and mask it into the composite manually. In some cases, the best result is a carefully selected combination of stacked and single-exposure areas.
Color and tonal consistency deserve a final check. The merged file may show subtle differences where Photoshop has taken pixels from different exposures. A Curves adjustment layer, selective color correction, or localized mask can unify the result without flattening the document prematurely. Save a layered PSD or PSB version before exporting a finished JPEG or TIFF.
Choose The Right Workflow For The Subject
Macro photography is the classic application because magnification makes depth of field extremely thin. A flower, jewelry item, watch, or small mechanical object may need dozens of frames for complete coverage. The focus interval should become smaller as magnification increases and as the subject contains fine, high-contrast details.
Product and still-life photographers benefit from the repeatability of a controlled stack. Use a fixed light source, a stable background, and manual white balance. Avoid flickering lights and any reflections that change from frame to frame. Reflective surfaces can be particularly demanding because even a tiny shift may alter the appearance of highlights.
Landscape photographers can use focus bracketing when a foreground element is close to the camera and the background extends to infinity. Capture one frame focused on the foreground, additional frames through the middle distance, and a final frame focused near the distant scene. Wind and changing light make this application less predictable, so a fast sequence and short shutter speeds are valuable.
Photoshop is often sufficient for straightforward stacks, while more specialized tools may offer advanced retouching or depth-map controls. Image enhancement tools can complement the finished composite, but they should not be used to disguise capture problems. This Photo AI comparison explains how different automated tools approach sharpening, noise reduction, and image refinement.
Build A Reliable Stacking Routine
A repeatable process reduces technical surprises and makes it easier to identify where a problem occurred. Keep the camera fixed, record the aperture and focus interval, and review the sequence before moving the setup. When the subject is valuable or difficult to recreate, capture more overlap than seems necessary.
Use these practices as a concise field and studio checklist:
- Mount the camera securely and disable settings that may change between frames, including auto white balance and auto exposure.
- Focus from the nearest important detail to the farthest, using smaller focus steps for close macro subjects.
- Capture extra frames with overlapping depth-of-field zones rather than relying on the minimum number of exposures.
- Inspect the automatic blend at 100 percent and repair masks around edges, highlights, and fine textures.
- Preserve the layered Photoshop document so masks and individual source images remain available for later corrections.
The number of frames depends on the subject’s depth, magnification, aperture, and the acceptable level of detail. A shallow still life may need only three or four exposures, while a highly magnified insect or technical object can require dozens. More frames are not automatically better; overlap and consistency are more important than volume.
For photographers who regularly work with digital imaging, the broader Sensorgraphy photography site offers additional perspectives on cameras, software, editing workflows, and the changing photography industry. A stacking technique becomes more useful when it is integrated into a considered approach to exposure, file management, and finishing.
Focus stacking is most successful when the photographer treats capture and editing as one connected process. Start with a stable sequence, use Photoshop’s alignment and blending tools, then refine the masks instead of accepting every automatic decision. With practice, the technique makes exceptional depth of field possible while retaining the detail and character of a carefully chosen lens.
Apply the workflow to a simple stationary subject first, save both the layered and final versions, and compare the composite with the sharpest individual frame. Repeating that exercise with progressively deeper subjects will build the control needed for demanding macro, product, landscape, and still-life work.