Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Stacking settings

The dock’s Settings tab holds everything the next fuse of a project uses: how the frames are repaired and evened out in brightness, how they are lined up, which fusion method combines them and how the result is trimmed. The defaults suit most stacks, so you can fuse without ever opening this tab. When a result disappoints, this page tells you which setting to try and why.

The Settings tab of a freshly opened stack: every section at its defaults.

Open the Settings tab

  1. Open a folder of frames or a saved project (see Ways to open a stack).
  2. Make sure the dock’s mode switch at the top right reads STACKING. In the editor the tab is not shown.
  3. Click Settings next to Images in the dock.

The tab shows the settings of the project tab you are looking at. With no project open, the dock reads “No project open.” instead.

How the tab is laid out

The tab has four sections, in the order a fuse uses them:

SectionWhat it doesWhat it holds
PREPARERepairs sensor defects and evens out the brightness of the frames before anything elseBrightness equalization and sensor defect removal
ALIGNLines the frames up so that the same detail sits at the same place in every frameThe alignment switch, method and settings
FUSECombines the frames into one sharp imageThe fusion method and its settings
FINISHTrims the resultAuto-crop

A change applies to the next fuse of this project tab. Results you have already kept stay as they were; fuse again to see the effect (see Checkpoints and saving for how each result is kept).

The DEFAULT badge

A section’s heading carries an orange DEFAULT badge while you have not touched any of its settings. As soon as you change a value in a section, its badge disappears, so you can see at a glance where you have changed something.

  • Setting a value back to what it was does not bring the badge back: the section still counts as changed. Only Reset All to Default does.
  • In ALIGN, the Enabled switch counts: switching alignment off, or off and on again, removes the badge.
  • Choosing another fusion method changes no value, so FUSE keeps its badge.

More…

Settings you rarely need sit behind a More… bar in each section. Click More… to open it; the arrow on the right points up while it is open. Click it again to fold it away. An open More… stays open when you choose another method and when you reset.

At first, PREPARE shows nothing but its More… bar, because all its settings live there.

Sliders, switches and menus

  • Sliders. Click anywhere on the track to jump there, or drag the round handle. The value at the right is plain text, not a field you can type into; it always shows the step’s decimals (Max brightness gain reads 1.20, Sharp-source preference 4.0). After clicking a slider, the Left and Right arrow keys move it one step at a time (whole numbers step by one, the brightness sliders by their own step). The Epsilon (px) slider in ALIGN spans several powers of ten and has no keyboard steps.
  • Switches. Click to turn on (orange) or off (grey).
  • Menus. Click the field to open the list, then click an entry. The current entry has a check mark; the grey text beside each entry is the name the command line uses for it.

The tab scrolls when it does not fit: use the mouse wheel over it or drag the scrollbar at its right edge. The heading of the section you are in stays at the top while you scroll.

PREPARE: repair defects and even out brightness

PREPARE with its More… bar open, at the defaults: equalization and defect removal are off.

Brightness equalization

The frames of one stack rarely have exactly the same brightness: a flash fires a little stronger or weaker, the lens lets in slightly less light as focus moves closer, mains light flickers. Fused as they are, such differences show as blotches where the result switches from one frame to another. Brightness equalization prevents that. With Equalize brightness on, FocusForge gives every frame one brightness factor (a gain) before aligning, the same on every colour channel, so that every frame reaches the same average brightness. It is off by default: turn it on for a stack whose frames differ in brightness.

SettingRangeDefaultWhat it does
Equalize brightnesson / offoffGives each frame one gain so that all frames share one average brightness before they are aligned.
Max brightness gain1.01 to 2.00, in steps of 0.011.25Limits how much a frame may be brightened or darkened. 1.25 allows a frame to be made up to 1.25 times brighter or down to 0.8 times as bright (1 ÷ 1.25), about a third of a stop either way.
Target brightness (stops)−0.5 to +0.5, in steps of 0.10.0Moves the shared brightness the frames are brought to. 0.0 keeps the frames’ average brightness; each stop doubles (+1) or halves (−1) it, so the range covers half a stop up or down.

While the gains are measured, the bottom bar reads Preparing with a count that rises to its total, frames for camera RAW and steps for TIFF and JPEG, for example “3 of 8”. Fusing the same TIFF or JPEG frames again with the same two brightness settings reuses the measurement and skips this step.

Things to know:

  • For camera RAW frames the gain corrects exposure in linear light, the way a change of exposure time would. For TIFF and JPEG frames it scales the pixel values as the files deliver them. Either way it does not touch your source files.
  • With Equalize brightness off, the two sliders below it are greyed and have no effect. They keep their values, so switching equalization back on restores them.
  • The gains a run used are stored with the project, so an exported image shows the equalized result.

When to change these settings:

  • Switch equalization on for a stack whose brightness varies by accident. Small flash-to-flash variation, the slight darkening of a focus-ring stack and mild flicker are exactly what it is for.
  • Leave it off when the frames already match, when the brightness change between frames is intended, or when you have matched the frames in another program and want them fused exactly as they are.
  • Raise Max brightness gain when FocusForge reports that a frame was held at the limit (see below) and you know that frame is only somewhat darker or brighter. Do not use it to rescue a frame that is far off, such as one whose flash did not fire: leave that frame out with Exclude in the Images panel instead.

Equalization switched on, with the target moved to −0.2.

Set a brightness target

Target brightness (stops) lets you make the whole stack a little brighter or darker as part of the fuse, for example when every frame came out slightly underexposed. The slider reads with a sign: −0.2, 0.0, +0.3. It snaps to tenths of a stop, and the arrow keys move it by 0.1 up to the ends at −0.5 and +0.5.

Tip: The target and the gain limit work together. With the default Max brightness gain of 1.25, no frame can move by more than about a third of a stop, so a target of +0.5 cannot be reached and every frame is held at the limit. To move the stack by half a stop, raise Max brightness gain to about 1.45 or more.

A brightness change made here is modest by design. For larger corrections, adjust the exported image in your photo editor.

When a frame needs more than the limit

A frame that would need a larger gain than Max brightness gain allows is brightened or darkened only up to the limit. After the run, FocusForge reports it in a notification titled “Brightness not fully matched”, naming the frame in the sentence “<file> could not be brought to the same brightness as the other frames.” The notice names the frame only. See Projects, notifications and quitting for where notifications appear.

The result is still usable: only that frame stays a little brighter or darker than the rest. If you see blotches where it contributed, raise Max brightness gain and fuse again, or exclude the frame.

Remove sensor defects

A sensor can have stuck, hot or dead pixels: points that show the same wrong colour in every frame. Because they sit at the same place in each frame, they survive fusing as a fixed speck. With Remove sensor defects on, FocusForge replaces each such pixel with a value worked out from its neighbours, before the frames are aligned. Your source files stay as they are.

SettingRangeDefaultWhat it does
Remove sensor defectson / offoffRepairs the defective pixels in every frame.
Find hot pixelson / offonLooks for pixels that differ from their neighbours at the same position in more than half the frames. Only used with the switch above on.
Hot pixel threshold2 to 507How far a pixel must stand out to count as hot. A higher value finds fewer. Only used while Find hot pixels is on.
Grow defect mask0 to 16 pixels0Widens every spot of a defect mask file by this many pixels. Only used with a defect mask file, which you give on the command line (see Remove sensor defects from the command line).

For colour camera RAW frames FocusForge also repairs the four neighbours of each hot pixel, because developing the picture spreads the defect to them.

ALIGN: line the frames up

ALIGN moves every frame so that it lines up with one reference frame before fusing, correcting drift and the change in image size as focus moves. It is on by default.

SettingRangeDefault
Enabledon / offon
AlgorithmPyramidal ECCPyramidal ECC
Mode (under More…)Translation only, Rotation + ScaleRotation + Scale
Max Iterations (under More…)1 to 1000400
Epsilon (px) (under More…)0.000000001 to 10.0001
Pyramid Depth (under More…)0 to 16worked out from the frame size
Reference Policy (under More…)Anchor, ChainChain
Reference Frame (under More…)First, Middle, LastMiddle

Switching Enabled off greys out the rest of the section. What each setting does, and when to change it, is explained in Alignment.

FUSE: choose how the frames are combined

The FUSE method menu: three fusion methods.

FUSE decides, for every pixel, which frames the result takes it from. Its Algorithm menu offers three methods; each one brings its own settings, which appear below the menu when you choose it. Every method remembers its own settings while the project tab is open: try Soft transitions with a higher preference, switch to Details and back, and your Soft transitions values are still there.

Details

The default. Details splits every frame into layers from coarse to fine, takes the sharpest frame’s contribution in every layer separately and puts the layers back together.

SettingRangeDefaultWhat it does
Levels (under More…)1 to the deepest level the frames supportworked out from the image sizeHow many layers of detail are compared and blended.

The default of Levels is not a fixed number: FocusForge works it out from the frame size each time (it reads 5 for 512-pixel frames). Leave it there. More layers make every piece of work far larger and slower. The slider ends at the deepest level your frames support, so a run cannot be started with a value that is too deep. A saved project can still hold a deeper value: the slider then shows “Allowed range 1 to N” and Fuse stack waits until you move it back.

Details has one setting, Levels, worked out from the frame size.

Soft transitions

Instead of choosing a winner, Soft transitions blends every frame at each pixel, giving sharper frames more weight.

SettingRangeDefaultWhat it does
Sharp-source preference1.0 to 8.0, in steps of 0.14How strongly the sharpest frame is preferred where frames overlap. Low values blend smoothly; high values lean towards picking the sharpest frame.
Radius (under More…)0 to 16 pixels16How far around itself each pixel looks to judge how sharp it is.

Raise Sharp-source preference for crisper detail (the result moves towards what Details gives); lower it for gentler transitions. A smaller Radius judges sharpness from a tighter neighbourhood around each pixel.

Soft transitions: Sharp-source preference, and Radius under More…

Focus map

Focus map first builds a map of which frame is sharpest where, smooths that map so that neighbouring pixels agree, and then takes each pixel from the one frame the map names. It produces the most orderly Z-Map (the record of which frame each pixel came from) of the three methods.

SettingRangeDefaultWhat it does
Score Radius (under More…)0 to 16 pixels4How far around itself each pixel looks to judge how sharp it is.
Smoothing Radius (under More…)0 to 16 pixels8How far the sharpness map is smoothed, so that neighbouring pixels agree on which frame is in focus.

A larger Smoothing Radius gives larger, calmer areas from one frame; a smaller one follows detail more closely but can switch frames more often.

Focus map: both of its settings sit under More…

Choose a fusion method

The same eight frames of a mantis, fused with each method at its defaults:

The three fusion methods on the sample stack; the lower row enlarges the framed area.

MethodWins whenTrade-off
DetailsYou want the most fine detail: insects, textures, hair, most subjects. Start here.At strong depth edges (a near outline against a far background) it can leave a halo. It is also the fastest on a computer with a usable graphics card; the other two always run on the processor.
Soft transitionsDetails shows seams, halos or harsh edges between frames; smooth subjects such as petals or glossy surfaces, where gentle transitions matter more than the last bit of texture.Fine detail is softer, because neighbouring frames are mixed in.
Focus mapYou plan to retouch: each area comes cleanly from one frame, which makes the Z-Map easy to read and paint from. Simple, solid subjects with clear depth.In smooth areas with no detail in any frame, such as a blurred background, the map has little to go on and the result can show patches, as in the example above.

A practical approach:

  1. Fuse with Details.
  2. If you see halos, seams or blotches, change the method under FUSE to Soft transitions and fuse again. FocusForge reuses the alignment from the first run, so the second fuse is much quicker.
  3. Compare the two results in the CHECKPOINTS list (see Checkpoints and saving) and keep the better one. Repair what remains by retouching.

Common failure images shows what halos, motion and focus gaps look like and which settings help.

FINISH: trim the edges

SettingRangeDefaultWhat it does
Auto-cropon / offonTrims the result to the area that every aligned frame covers. Turn it off to keep the full frame.

Aligning moves frames by a few pixels, so along the edges some frames leave a strip with no picture. Auto-crop cuts those strips off, so the result has clean edges. Turn it off when you would rather keep every pixel and crop by hand later. The outer strip then includes areas that not every frame covers.

Reset All to Default

Reset All to Default sits at the bottom of the tab, below FINISH (scroll down to reach it). It is greyed until you have changed something.

Clicking it:

  • returns every setting of every section on this project tab to its default, and every section’s DEFAULT badge comes back;
  • also forgets the values each fusion method remembered for this tab;
  • keeps the fusion method you chose: if FUSE reads Focus map, it still does, now with the Focus map defaults;
  • leaves open More… bars open.

It does not ask first, and it affects only the project tab you are looking at. It does not change any result you have already kept.

After one change (here: alignment switched off) Reset All to Default becomes available.

Each project tab has its own settings

Settings belong to the project tab, not to the window. When you have two projects open, each keeps its own method and values; click the other tab and the Settings tab shows that project’s settings.

  • A project you reopen from its .ffp file starts with the settings recorded in it, so the sections show the values that project was fused with rather than DEFAULT badges.
  • New project instead, offered when you change the frames of a project that already has a result (see the Images panel), opens the new tab with this tab’s settings.
  • The values each method remembers while you switch between methods are kept only while the tab is open; the project file records the settings of the runs you keep.

While a fuse is running

During a run the Settings tab is faded and locked.

From the moment you click Fuse stack until the run is over, the Settings tab of that project is drawn faded and does not react to clicks. That holds while the run is paused and while it is being cancelled, too: a run keeps the settings it started with. When the run ends (kept, discarded, cancelled or failed), the tab works again.

The lock applies only to the project that is fusing. Click another project tab and you can change its settings while the first one runs.

Tip: To try a different setting, let the run finish (or Cancel it), change the setting, and click Fuse stack again. See Opening and fusing in detail for Pause, Cancel and the Keep or Discard question.

From the command line

Everything on this tab is also available to focusforge-cli. The window shows each method’s display name; the command line takes its id:

In the windowOn the command line
Detailslaplacian
Soft transitionsweighted-average
Focus mapdepth-map
Pyramidal ECCpyramidal-ecc

focusforge-cli algorithms lists them, and focusforge-cli algorithms <id> prints every setting a method has, with its id, range, default and a short description. The command-line reference has the full listing.

Stack a folder

focusforge-cli stack path/to/frames/ --algorithm laplacian

stack fuses a directory of TIFF or supported RAW frames into a project; it does not write an image file (export does that, below). path/to/frames/ is read non-recursively, or from a frames/ subdirectory when one exists. The project is written beside the frames as <dir>/<dir-name>.ffp, or into the directory given with -o/--output. For a folder holding more than one stack, see Batch runs from the command line. Alignment and the auto-crop are on by default, as in the window; see Alignment for their flags. reference/cli.md lists every flag.

Set any declared setting with --set key=value (repeatable), using the ids focusforge-cli algorithms <id> prints:

focusforge-cli stack path/to/frames/ --algorithm weighted-average --set weight-exponent=6 --set radius=8
focusforge-cli stack path/to/frames/ --algorithm depth-map --set smoothing-radius=12
focusforge-cli stack path/to/frames/ --algorithm laplacian --set levels=4

Leave levels unset and it is derived from the stack’s resolution, as in the window.

RAW frames

Put one kind of RAW file in a directory and run the same command as for TIFF; focusforge-cli info reports camera metadata before a stack run. TIFF, JPEG and RAW frames form separate stacks, and a group that mixes them is refused. A RAW file FocusForge cannot read is reported by name.

RAW frames are developed to the camera’s own linear colour and fused without clipping, so highlights above white survive the blend. Saturated highlights come out neutral white, never magenta, on the canvas, in thumbnails and in TIFF, PNG and JPEG exports. The result is clipped once, to 16 bits, when it is exported. A RAW project saved by an earlier version is refused on open; stack its source frames again (see A RAW project saved by an earlier version).

Adding --raw-precision f32 keeps the developed frames at full precision and doubles the temporary disk space they take (see stack).

Brightness equalization flags

The PREPARE settings are the project settings equalize, equalize-max-gain and equalize-target:

focusforge-cli stack path/to/frames/ --algorithm laplacian --set equalize=false
focusforge-cli stack path/to/frames/ --algorithm laplacian --set equalize-max-gain=1.5
focusforge-cli stack path/to/frames/ --algorithm laplacian --set equalize-target=0.2

A frame held at the limit makes the run print a notice naming the frame and the gain it needed. The gains are recorded in the project, so export writes the equalized result.

Fusing the same TIFF or JPEG frames again with the same two brightness settings reuses the measurement. --no-cache measures afresh, and Clear cache in the settings window removes what is stored.

Remove sensor defects from the command line

focusforge-cli stack path/to/frames/ --set defect-removal=true
focusforge-cli stack path/to/frames/ --set defect-removal=true --defect-mask path/to/mask.tif

The mask is a grey image the size of the frames in which black pixels mark the defects. To see which pixels FocusForge would find, without fusing:

focusforge-cli hot-pixels path/to/frames/

It prints the number of hot pixels found; the command-line reference has its options.

Getting an image back

focusforge-cli export path/to/frames/frames.ffp -o out.tif --zmap zmap.tif

export reads a project and writes the image (-o), the Z-Map (--zmap), or both in one invocation. --frame/--frame-output also count; at least one output is required. The image is rendered from the project’s stored composite, so it reflects the checkpoint you ask for (the newest by default; --checkpoint <id> picks another). An unretouched checkpoint needs no source frames; a retouched one reads them again and checks them against the hashes recorded when the project was written, and a missing or changed frame is named with nothing written. export refuses an output path that names the project itself.

The format follows -o’s extension: .tif, .png or .jpg, each with its own options:

focusforge-cli export frames.ffp -o out.png --png-bits 8 --png-compression best
focusforge-cli export frames.ffp -o out.jpg --jpeg-quality 90 --jpeg-subsampling 444
focusforge-cli export frames.ffp -o out.tif --tiff-bits 16 --tiff-compression lzw

TIFF and PNG default to 16 bits and JPEG to quality 95 with 4:2:0 chroma subsampling. EXIF from the alignment reference frame and an ICC profile are carried into the image by default; --xmp on and --iptc on carry those too (IPTC is never written to PNG), and --exif off / --icc off leave them out. In the window, the same choices are in the export dialog: see Exporting an image. reference/cli.md lists every flag.

Getting the Z-Map

Every project already carries its Z-Map, a single-channel 16-bit TIFF naming, per pixel, which source frame contributed. Pass --zmap to export to write it out. Retouch strokes are not included in an exported Z-Map: it is the one the fusion produced, so on a retouched checkpoint it does not match the exported image, while the overlay and the pipette in the window do count the strokes.

focusforge-cli stack path/to/frames/ --algorithm depth-map
focusforge-cli export path/to/frames/frames.ffp --zmap zmap.tif

Using the GPU

When a usable graphics card is present, stack uses it automatically for laplacian; weighted-average and depth-map always run on the processor. --cpu forces the processor. Without a usable card the run continues on the processor and prints why on stderr. If the card is lost partway through, the rest of the run finishes on the processor; see Diagnostics and crash reports for where that is logged. The result is the same either way, and --json’s backend field says which one ran. In the window, the same choice is GPU processing in the settings window.

Reading the result

focusforge-cli stack path/to/frames/ --algorithm laplacian --json

--json reports the frames that were read, the algorithm and settings that were used and the project path written; see reference/cli.md for the full report. --no-progress turns off the progress line printed while a run goes.