
For a focus stack, Enfuse's normal weighted averaging can mix an in-focus detail with softer versions of that detail. The Enfuse 4.2 manual recommends local-contrast weighting with --hard-mask for this task. Hard masks avoid averaging fine detail at the finest scale, trading away some noise reduction. They do not correct misregistered frames or guarantee clean edges.
Key Takeaways
- Exposure fusion and focus selection need different weighting criteria.
- Hard masks preserve selected fine detail but can increase visible noise.
- Alignment errors and contrast-window edge artifacts need separate diagnosis.
First distinguish alignment from averaging
In a hypothetical product stack, lettering is sharp in one exposure and the rear edge is sharp in another. Compare the aligned inputs at those locations before changing fusion settings. If the same letter occupies different coordinates, hard masks cannot make the source geometry agree.
Focus changes can also change apparent magnification. The focus-breathing explanation helps identify that capture relationship. Register the frames before asking Enfuse to choose their sharp regions.
Use the documented focus-selection combination
The local-contrast procedure in the official Enblend/Enfuse 4.2 package manual, section 8.6.3, turns off exposure and saturation selection and turns on contrast selection. For three already aligned TIFFs, an illustrative command is:
enfuse --exposure-weight=0 --saturation-weight=0 --contrast-weight=1 --hard-mask --output=focused.tif aligned-near.tif aligned-middle.tif aligned-far.tif
These names stand for actual prepared inputs, not a promise that the command aligns them. The hard-mask option is important: retaining contrast weighting alone still permits contributions from softer sources. The manual describes hard masks as selecting the best-weighted pixel instead of averaging all candidates at the finest scale.
Do not interpret that as an ordinary all-or-nothing cutout at every pyramid scale. Enfuse still performs multi-resolution fusion.
Recognize the contrast-window failure
The basic sharpness measure is the standard deviation inside a moving square window. Strong boundaries can distort that measure. Section 8.6.4 describes faint dark seams on the light side of a high-contrast edge and lighter, soft seams on the dark side, at distances related to the window size.
If those artifacts are absent, the manual advises retaining the basic method. If they appear, compare source alignment and saved masks before moving into advanced edge-detection tuning. Increasing global sharpening after fusion may emphasize the seam rather than correct its cause.
Accept detail and noise together
For a proposed comparison, inspect small lettering, smooth surfaces and bright/dark boundaries in the soft-mask and hard-mask versions. Look for selected sharp detail, displaced edges and noise differences separately. A crisper edge is insufficient if the surrounding surface becomes unacceptable.
Keep the source stack. The macro-stack preparation guide covers the earlier decision to combine recorded focus planes before stylizing the product. This guide addresses the subsequent pixel-selection mechanism; no focus stack or noise benchmark was executed here.
Related tasks
- Should I Focus-Stack Product Macro Photos Before AI Styling?
- Why Does My Reference Video Slightly Zoom When Only the Focus Changes?
Sources and scope
- Enfuse 4.2 official package manual: Enfuse 4.2 sections 8.6.2-8.6.4 and --hard-mask: precise registration prerequisite; exposure/saturation weights zero, contrast one; hard selection avoids fine-scale averaging at the cost of noise; moving-window standard deviation and high-contrast edge seam artifacts.
Research checked on 2026-10-23 (Asia/Shanghai). The official SourceForge archive returned HTTP 200 and its bundled 4.2 HTML manual was extracted and read locally; this is not a claim that the public manual HTML endpoint was readable. Enfuse 4.2 sections 8.6.2-8.6.4 and --hard-mask: precise registration prerequisite; exposure/saturation weights zero, contrast one; hard selection avoids fine-scale averaging at the cost of noise; moving-window standard deviation and high-contrast edge seam artifacts. Commands and comparison procedures are illustrative and were not executed; the cover is decorative.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Mariya Eskina / Pexels, Pexels License. This is an illustrative source photograph, not an application screenshot or a generated test result.