lapstack

Option reference

Every option lapstack --help lists, grouped. Defaults are in brackets.

Output

OptionDefaultWhat it does
-o, --output PATHstacked.pngThe fused image. A .dng extension writes a linear DNG
--no-metadataoffDo not copy the first frame's EXIF, ICC profile or XMP into the output
--no-cropoffKeep 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-depthoffWrite 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-confoffWrite the depth confidence map (sixteen-bit, 65535 = 1)

Fusion

OptionDefaultWhat it does
--levels NautoBand-pass levels. Automatic keeps the residual's short side ≥ 32 px
--energy-radius R1 (3×3)Region-energy window radius, binomial weights. 0 is the per-node |L| maximum
--top RULEdeResidual rule: de (deviation + entropy, the paper's), dev, avg
--top-radius R2 (5×5)Deviation/entropy window radius at the residual
--entropy-bins N256Gray levels for the entropy histogram
--use-chromaoffTake energy from R, G, B instead of luma
--halo-control P0 (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

OptionDefaultWhat it does
--no-alignoffFrames are already registered — streams from disk
--align-coarsen N0Align at reduced resolution, skipping N finest levels
--align-model Msimilaritysimilarity (shift, scale, rotation), affine (+ aspect, shear), projective (+ perspective)
--no-shiftoffRemove shift from the model
--no-scaleoffRemove scale from the model
--no-rotationoffRemove rotation from the model
--interpolation Kspline4x4Resampling kernel: nearest, bilinear, bicubic, spline4x4, spline6x6, lanczos3
--no-brightnessoffDo not equalize the frames' brightness to frame 0

See alignment. --align-coarsen 2 is the practical setting.

Frames

OptionDefaultWhat 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 N0Block-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)
--reverseoffReverse 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

OptionDefaultWhat it does
--slabs SIZE[:OVERLAP]overlap 2Also fuse every run of SIZE consecutive frames on its own — Zerene's slabbing: thick planes of focus to retouch from
--slab-dir DIR<stem>_slabsWhere the slabs go, in the output's format
--wavoffAlso write the weighted average (Helicon's method A) to <stem>_wav.<ext>
--wav-power P2The contrast raised to P before weighing. 1 is plain, higher is keener
--wav-smooth R1Box 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

OptionDefaultWhat it does
--depth MODEdffdff = depth from focus; winner = the raw pyramid winner map
--depth-level L2(For winner) the pyramid level the map is read from. Also the guide level for halo control
--depth-scale S1Work at 1/2^S resolution
--depth-focus Frdf:1:3Focus measure: rdf[:RIN[:ROUT]] (ring difference filter) or sml[:STEP] (sum-modified Laplacian)
--depth-agg R[:EPS]3:1e-4Guided-filter aggregation radius and regularizer. 0 is off
--depth-lambda L3Weighted-least-squares smoothness. 0 is off
--depth-sigma S0.04WLS guide-edge sensitivity, in luma units
--depth-cg N200WLS conjugate-gradient iteration cap
--depth-no-medianoffSkip the 3×3 median before the WLS
--depth-gate G1Noise gate: full confidence needs a peak ≥ (1+G) × the noise floor. 0 is off
--depth-robust T1Huber reweighting of the WLS data term, in frames. 0 is off
--depth-upsample Uguided:2:1e-2bilinear or guided[:R[:EPS]]

See depth from focus. The defaults are good; the one worth touching is --depth-scale.

Dust map

OptionDefaultWhat it does
--dust-map FILE—A frame of an evenly lit blank surface shot out of focus at the stack's aperture
--dust-threshold PCT3A pixel darker than its background by more than this is dust
--dust-margin PX3Pixels the spots are grown by
--dust-mode MODEfillfill 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

OptionDefaultWhat 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,blCorners: tl, tr, bl, br
--overlay-size PCT3Font size as a percentage of image height; everything else scales with it
--overlay-color Cwhitewhite or black
--overlay-style Shalohalo (a thin outline in the other color), box (a translucent box behind), plain

See scale bar and captions.

Stereo, rocking and 3D

OptionDefaultWhat it does
--stereo PCT[:LAYOUT]—Synthetic stereo pair to <stem>_stereo.<ext>. LAYOUT is sbs (default), cross or anaglyph
--rocking PCT[:N]N = 24Rocking 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 EautoWhich 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 PCT25The depth of the stack as a percentage of image width
--mesh-grid N1000Vertices along the long edge
--mesh-texture EDGE[:jpeg[:Q]|png]8192, jpeg:92The texture's long edge (0 = full) and format

See stereo, rocking and 3D.

Batch

OptionDefaultWhat it does
--split RULE—count:N, gap:SECONDS, or dir
--dry-runoffList 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

OptionWhat it does
--gpuFuse on the CUDA GPU (needs the gpu build feature)
--gpu-alignRun the aligner's cost search on the CUDA GPU

See GPU acceleration.

Environment

VariableWhat it does
LAPSTACK_NO_POOL=1Turn off the pooling global allocator. Output is unchanged; the CPU fold takes roughly twice as long. For troubleshooting and measurement

Source: sites/lapstack/content/docs/cli/options.md