Focus Depth Editor
Choose which focus slice supplies each part of your photo and where to retain extra detail, with a live preview as you edit.
Get Started
Select one complete focus bracket in Lightroom Classic, then choose Merge Raw Files. Pick No Alignment - Tripod for a fixed camera, or Auto Align if the camera moved. Both correct focus breathing; the slices you see in the editor already share the merge's alignment.
- Focus Stacking - Automatic Depth Map: merge immediately using the estimated depth.
- Focus Stacking - Custom Depth Map: open the depth editor after alignment and automatic depth estimation, make corrections, then finish the merge.
Both options retain extra fine detail in the final DNG. The custom editor lets you control where that detail is added. Its quick preview combines the current depth blend with full-resolution fine detail; it approximates the final blend, which is recomputed when you save.
Shoot a continuous near-to-far bracket, covering everything you want sharp. Moving subjects and regions that were never in focus may still need retouching. Pixel Shift alignment also supports both focus options for a bracket made from complete pixel-shift sequences.
How the Focus Stack Is Built
MergeRAW combines a depth-guided blend with a separate pass to preserve fine detail. The aim is a sharp subject with smooth, natural-looking backgrounds.
First, it aligns the photos and matches their brightness. Tripod alignment compensates for focus breathing, the slight change in image size as the lens refocuses. Auto Align also corrects camera movement. Brightness matching helps prevent patches where lighting varies between shots.
Local sharpness across the stack supplies a weighted depth map, a guide to which photo should supply each part of the result. It describes image detail, not a precise distance. Clear texture carries more weight than noise, broad blurred edges or areas that never come into focus.
The map is refined using reliable neighboring regions and broader image patterns, helping keep blurred backgrounds from breaking into patches from different frames. When the evidence supports it, a surface beyond the captured focus range can favor the appropriate end frame.
A clear depth choice takes pixels from one photo; a position between frames blends those neighbors. The blend stays narrow to avoid softening a sharp source with too much of an unfocused one.
Finally, a fine-detail pass recovers texture softened by the depth blend. It separates detail into several scales and selectively replaces the corresponding detail in the blended image. Checks against the underlying image limit halos and inconsistent contributions. This can reduce the blurred region around foreground edges and even retain spiderwebs in front of the subject.
The result keeps the smooth structure of a depth-based stack while recovering more detail from the originals. It uses conventional image processing and requires no AI model.
Compare Views

The Visualize section controls what you see, independently of the editing tool.
- Side-by-side: keep the live composite on one side and your chosen overlay on the other. Zoom and pan stay linked.
- Overlay: work in a single image pane. Switching layouts preserves your zoom.
- Depth Map: white represents the nearest focus and black the farthest. Look for isolated holes or a boundary that crosses the subject.
- Detail Mask: white retains extra detail, black removes it, and gray blends between the two. Removing extra detail reveals the current depth blend.
- Source Image: compare the aligned source selected beside Paint slice with the composite.
- Source Peaks: inspect fine detail in that source. Brighter areas have stronger detail relative to their local brightness; sensor noise can also register. Compare slices to find a useful source.
Opacity blends the chosen mask, source image or peaking view over the composite. Press Q to hide it, then press Q again to restore its previous opacity. The underlying composite updates as you edit.
The slider beside Paint slice controls both the source you view and the source you paint. Changing it switches to Source Image, or keeps Source Peaks if that view is already selected. Use Z / X, or , / ., to cycle backward / forward; the selection wraps at either end.
Edit Depth & Detail
| Control | What it does |
|---|---|
| Paint slice · B | Paint the selected captured slice into a problem area. Find a sharp source with the adjacent slider, then paint where that source should contribute. This brush always has a hard edge. |
| Smooth · S | Soften local variations in depth. Use sparingly at a real near/far boundary, where smoothing can mix an out-of-focus neighbor into the result. |
| Flatten · A | Fill holes by moving depth toward the most common value under the first brush dab. That target stays fixed for the stroke; start on the surface you want to extend. |
| Snap to nearest slice · E | Move intermediate depths toward the nearest captured slice. At full strength this selects a single slice, useful for small stacks where blending between widely spaced planes looks soft. |
| Snap to sharpest slice · W | Choose the slice with the strongest total Source Peaks evidence under each brush dab, then paint that depth with the current falloff and strength. Keep the brush on the surface you want sharp. |
| Retain extra detail · D | Restore fine detail from the automatic detail blend in the brushed area. |
| Remove extra detail · C | Reduce the extra detail contribution and reveal more of the depth blend. |
| Restore original depth · R | Move an area back toward the automatic depth map. |
Edit Depth Map contains Paint slice, Smooth, Flatten, both Snap tools, and Restore original depth. Extra Detail contains Retain extra detail and Remove extra detail. The depth and detail masks are independent.
Start with a small correction and compare the result with Q. For holes within one surface, try Flatten. For a stubborn misplaced edge, find a sharp source and use Paint slice.
With depth tools, hold Shift to smooth temporarily. While using Paint slice or Snap to sharpest slice, Option / Alt temporarily restores depth. With either detail brush, Option / Alt swaps between retaining and removing extra detail.
Brush & Preview
Size sets the brush radius. Hardness controls its edge, except for Paint slice, which is always hard. Strength works as flow: passing over the same spot repeatedly builds up the effect, even within one stroke. Reset brush restores the default size, hardness and 100% strength.
The Preview exposure and contrast sliders help reveal shadow detail or subtle transitions. They change only the displayed photo, not the depth map, final DNG or Lightroom develop settings. The starting preview approximates the source's white balance, exposure and contrast; Lightroom's final rendering may differ.
The depth blend uses reduced-resolution source images for responsive editing, with a full-resolution fine-detail preview added on top. Depth and detail masks display and blend smoothly. Inspect the completed DNG in Lightroom when judging the final fine-detail result.
Navigate & Save
| Control | What it does |
|---|---|
| [ / ] | Decrease / increase brush size. |
| Space + drag | Pan the image. |
| F / 0 | Fit the image / show 100% zoom. |
| Cmd / Ctrl + Z | Undo. Add Shift to redo. Clear all edits is also undoable. |
| Enter or Cmd / Ctrl + S | Save both masks and let MergeRAW finish the DNG. The prepared focus stack is reused, so it does not repeat conversion, alignment, or depth estimation. |
| Esc | Cancel the merge without producing a new DNG. |
After a successful merge, the depth map and detail mask are kept as compressed TIFFs beside the original: <name>_MergeRawDepthMap.TIF and <name>_MergeRawDetailMask.TIF. The next Custom Depth Map merge reuses them for the same stack. Clear all edits resets only the depth map to the current automatic result. Use No extra detail or Full extra detail to reset the whole detail mask. Each action is undoable.