lapstack

Retouching

Every focus stacker gets some places wrong, and the places are predictable: wherever one thing crosses another at a different depth. A hair in front of a background is sharp in one frame while the background behind it is sharp in another, and both want the same pixels.

Retouching is how you fix those places by hand — by painting the right frame's pixels into the result.

Entering the mode

Retouch is a mode of the Stack step, not a step of its own. The Retouch button sits in the viewer's top-right corner (or press R) whenever a stacked image — LAP, DFR or WAV — is on screen.

It turns the view into a side-by-side compare under one zoom and pan:

  • Left: the stacked image. Whichever layer was selected is the paint target.
  • Right: the brush source.

The brush controls appear above the run parameters in the panel.

Press the button again, Esc, untick vs, or leave the Stack layers to exit. The compare that was open before the mode returns.

Choosing a source

The panel's Source section, or S to cycle.

The scrubbed source frame

One aligned frame. The wheel, the frame slider, the filmstrip or ← / → choose it. (While a stroke is being dragged the wheel keeps zooming instead, so the frame cannot change under the brush mid-stroke.)

Full frames are not kept after a run, so the chosen frame is decoded again and re-warped with the registration the run found — about a second at 45 megapixels. The pane label reads loading full res… until it is there.

A slab

slab ± frames, default 5. This is Zerene's slab, made on demand: the scrubbed frame and its neighbors fused on their own, with the run's registration, brightness gains and fusion settings.

The brush then copies a thick plane of focus instead of one frame's thin sliver of it. On a deep stack this is what most retouching should paint from — a single frame at 1:1 macro may have only a millimeter of sharpness, and painting from it leaves you chasing the same problem one frame over.

The engine fuses the slab when the scrub settles (each frame is decoded again, about 0.6 s per 45-megapixel frame), reusing the run's accumulator on the GPU. It keeps one slab at a time and drops a build the scrub has moved away from. The filmstrip tints the slab's frames, and the right pane's label says how far the build has got. Once a slab exists it is also offered as a compare layer.

The other stacked result

After a Run LAP + DFR, the brush source can be the other stacked image: DFR while LAP is being painted, LAP while DFR is. This is the most productive retouching lapstack offers — brush the pyramid's fine detail into the depth-map rendering, and the rendering's smooth areas back into the pyramid image, the way Zerene retouches PMax into DMap.

A kept result

Any kept result of the run's size: an earlier run with different settings, a result loaded from a file, the command line's output, or another program's. A file of a different size can be viewed and compared but not brushed from.

The brush

A soft brush that copies the aligned source into the stacked image.

It shows its work before the button goes down. Wherever the cursor is, the dab a click would lay down is composited into the paint pane, under a circle marking the brush edge and its hard core. The circle shows on both panes; the preview shows on the paint pane, built at that pane's own scale and clipped to it — so a brush wider than the window costs no more than the window.

Nothing is committed until a stroke is painted. The preview stands aside for one pointer move after an undo or a redo, so a stroke reverted under the cursor is visibly gone.

GestureAction
Drag on either panePaint
Shift + dragPan
Ctrl + wheelZoom
[ ], or the panel's slidersBrush size and hardness
Ctrl + Z / Ctrl + Shift + ZUndo / redo a whole stroke

How a stroke is applied

While you drag, the stroke is previewed on the display copy. On release the worker applies it to the sixteen-bit master and sends back the exact patch, so what you are looking at is what the file will contain. The Save step writes the retouched image.

Undo history is capped at about 600 MB of patches.

Retouching and project files

A project file records the strokes — target, source and dabs — kept in step with undo and redo. When the project is opened and run again, the strokes are painted again in order, each from its source brought back: a frame decoded and warped, a slab fused, the other stacked image, or a kept result of the same label if one is loaded. The retouched image comes back pixel for pixel.

A stroke whose source is not available is left out, and the log says why.

Tip

Retouch at 100 % zoom or closer. At fit-to-window you cannot see the fringe you are fixing, and a brush that looks small on screen is enormous on the image.

Source: sites/lapstack/content/docs/app/retouch.md