Option reference
Every option lapstack --help lists, grouped. Defaults are in brackets.
Output
| Option | Default | What it does |
|---|---|---|
-o, --output PATH | stacked.png | The fused image. A .dng extension writes a linear DNG |
--no-metadata | off | Do not copy the first frame's EXIF, ICC profile or XMP into the output |
--no-crop | off | Keep the full frame instead of cropping to the area every aligned frame covers |
--crop X,Y,W,H | — | Cut every output to this window of the (turned) frame, in full-resolution pixels, on top of the automatic crop |
--save-aligned DIR | — | Write the aligned frames |
--save-depth | off | Write the depth map next to the output (eight-bit, min–max scaled) |
--depth-raw PATH | — | Write the depth map as a sixteen-bit PNG on a fixed scale (65535 = last frame) |
--save-conf | off | Write the depth confidence map (sixteen-bit, 65535 = 1) |
Fusion
| Option | Default | What it does |
|---|---|---|
--levels N | auto | Band-pass levels. Automatic keeps the residual's short side ≥ 32 px |
--energy-radius R | 1 (3×3) | Region-energy window radius, binomial weights. 0 is the per-node |L| maximum |
--top RULE | de | Residual rule: de (deviation + entropy, the paper's), dev, avg |
--top-radius R | 2 (5×5) | Deviation/entropy window radius at the residual |
--entropy-bins N | 256 | Gray levels for the entropy histogram |
--use-chroma | off | Take energy from R, G, B instead of luma |
--halo-control P | 0 (off) | Levels coarser than --depth-level do not pick their own winners; each is the mean of the frames weighed by that level's region energy raised to P. 1 weighs by the energy, higher is closer to a hard pick, 8 is the cap |
See fusion.
Alignment
| Option | Default | What it does |
|---|---|---|
--no-align | off | Frames are already registered — streams from disk |
--align-coarsen N | 0 | Align at reduced resolution, skipping N finest levels |
--align-model M | similarity | similarity (shift, scale, rotation), affine (+ aspect, shear), projective (+ perspective) |
--no-shift | off | Remove shift from the model |
--no-scale | off | Remove scale from the model |
--no-rotation | off | Remove rotation from the model |
--interpolation K | spline4x4 | Resampling kernel: nearest, bilinear, bicubic, spline4x4, spline6x6, lanczos3 |
--no-brightness | off | Do not equalize the frames' brightness to frame 0 |
See alignment. --align-coarsen 2 is the practical setting.
Frames
| Option | Default | What it does |
|---|---|---|
--rotate DEG | — | Turn every frame by 90, 180 or 270 degrees clockwise as decoded. A raw is already turned by its EXIF orientation |
--draft N | 0 | Block-average every frame by 2^N as decoded, so the whole run happens at 1/2^N the size |
--skip LIST | — | Leave frames out: 1-based positions and ranges, after directories are expanded and before any split (3,7-9,12) |
--reverse | off | Reverse the frame order (a stack shot back to front). Each stack of a batch on its own |
A position past the end, or a backward range, is an error — a typo should not silently stack the wrong frames.
Slabs and the weighted average
| Option | Default | What it does |
|---|---|---|
--slabs SIZE[:OVERLAP] | overlap 2 | Also fuse every run of SIZE consecutive frames on its own — Zerene's slabbing: thick planes of focus to retouch from |
--slab-dir DIR | <stem>_slabs | Where the slabs go, in the output's format |
--wav | off | Also write the weighted average (Helicon's method A) to <stem>_wav.<ext> |
--wav-power P | 2 | The contrast raised to P before weighing. 1 is plain, higher is keener |
--wav-smooth R | 1 | Box radius of the weight map on the depth pass's grid. 0 is none |
Slabs are written as they are made, as slab_01_000-009.tif and so on, with zero-based frame
indices. Each slab streams its frames from disk again.
See other renderings.
Depth
| Option | Default | What it does |
|---|---|---|
--depth MODE | dff | dff = depth from focus; winner = the raw pyramid winner map |
--depth-level L | 2 | (For winner) the pyramid level the map is read from. Also the guide level for halo control |
--depth-scale S | 1 | Work at 1/2^S resolution |
--depth-focus F | rdf:1:3 | Focus measure: rdf[:RIN[:ROUT]] (ring difference filter) or sml[:STEP] (sum-modified Laplacian) |
--depth-agg R[:EPS] | 3:1e-4 | Guided-filter aggregation radius and regularizer. 0 is off |
--depth-lambda L | 3 | Weighted-least-squares smoothness. 0 is off |
--depth-sigma S | 0.04 | WLS guide-edge sensitivity, in luma units |
--depth-cg N | 200 | WLS conjugate-gradient iteration cap |
--depth-no-median | off | Skip the 3×3 median before the WLS |
--depth-gate G | 1 | Noise gate: full confidence needs a peak ≥ (1+G) × the noise floor. 0 is off |
--depth-robust T | 1 | Huber reweighting of the WLS data term, in frames. 0 is off |
--depth-upsample U | guided:2:1e-2 | bilinear or guided[:R[:EPS]] |
See depth from focus. The defaults are good; the one worth
touching is --depth-scale.
Dust map
| Option | Default | What it does |
|---|---|---|
--dust-map FILE | — | A frame of an evenly lit blank surface shot out of focus at the stack's aperture |
--dust-threshold PCT | 3 | A pixel darker than its background by more than this is dust |
--dust-margin PX | 3 | Pixels the spots are grown by |
--dust-mode MODE | fill | fill interpolates each spot; flat divides it by the map's attenuation |
--save-dust-map PATH | — | Write the spots found as an image (white = dust) |
See dust map.
Scale bar and caption
| Option | Default | What it does |
|---|---|---|
--scale-bar CAL[:LENGTH] | — | CAL is µm per pixel (0.325, 325nm) or auto. LENGTH is the bar's length with a unit (100um, 2mm, 500nm); the default is the 1–2–5 value nearest a fifth of the width |
--text TEXT | — | A caption. \n breaks a line; {date}, {time}, {frames}, {first}, {n} are filled in |
--overlay-pos BAR[,TEXT] | br,bl | Corners: tl, tr, bl, br |
--overlay-size PCT | 3 | Font size as a percentage of image height; everything else scales with it |
--overlay-color C | white | white or black |
--overlay-style S | halo | halo (a thin outline in the other color), box (a translucent box behind), plain |
Stereo, rocking and 3D
| Option | Default | What it does |
|---|---|---|
--stereo PCT[:LAYOUT] | — | Synthetic stereo pair to <stem>_stereo.<ext>. LAYOUT is sbs (default), cross or anaglyph |
--rocking PCT[:N] | N = 24 | Rocking animation: N views sweeping ±PCT in one sine cycle, to <stem>_rocking/view_NN.<ext> |
--video FPS | — | With --rocking: join the views into <stem>_rocking.mp4 (H.264, CRF 18) by ffmpeg, if it is on the path |
--near-end E | auto | Which end frame 0 is: first, last (--far-first is the same), or auto from the EXIF focus distances |
--mesh FORMATS | — | 3D model: glb, obj, stl, comma-separated |
--mesh-relief PCT | 25 | The depth of the stack as a percentage of image width |
--mesh-grid N | 1000 | Vertices along the long edge |
--mesh-texture EDGE[:jpeg[:Q]|png] | 8192, jpeg:92 | The texture's long edge (0 = full) and format |
Batch
| Option | Default | What it does |
|---|---|---|
--split RULE | — | count:N, gap:SECONDS, or dir |
--dry-run | off | List the stacks and their output names, then stop |
With more than one stack, -o, --slab-dir, --save-aligned and --depth-raw become
templates: {n}, {first}, {dir}. A path with no field gets _NN before its extension.
See batch and scripting.
GPU
| Option | What it does |
|---|---|
--gpu | Fuse on the CUDA GPU (needs the gpu build feature) |
--gpu-align | Run the aligner's cost search on the CUDA GPU |
See GPU acceleration.
Environment
| Variable | What it does |
|---|---|
LAPSTACK_NO_POOL=1 | Turn off the pooling global allocator. Output is unchanged; the CPU fold takes roughly twice as long. For troubleshooting and measurement |