FocusFusion – Focus stacking and merging

FocusFusion is a windows application dedicated to focus stacking, aka focus merge. It starts from a set of images with a shallow depth of field, such as as for macrophotography, and combines theme to obtain a single image with a much greater depth of field.

Images are processed with at a minimum of 16bit per channel precision to preserve details from RAW images. Below is a list of supported format for source images:

  • TIFF up to 48bpp
  • JPEG XR (16bits per channel)
  • JPEG (classic 8 bits per channel)

It is available as FocusFusionX in the Windows Apps Store.

Requirements are a Windows 10 PC with a CPU manufactured after 2008 (SSE4.1 support), at least 8 GB of memory. 16 GB recommended for deeper stacks or larger DSLR images. Also, the more CPU cores your have, the better!

Recent changes and release history can be found in the FocusFusion changelog.

Focus stacking algorithms

Two algorithms are supported, which have different strength and weakness.

All the processing happens at a minimum of 16 bits per pixel.

Depthmap

This is the default algorithm, which provides good results in many usual situations. It works by measuring focus in the various source images, assigning them to a depth map, and then filtering that depth map.

It requires the source images to be presented strictly in order (front to back or back to front). The depthmap algorithm can preserve color well over large areas which are at the same focus depth. The weakness is that it can struggle when there is translucency or complex overlaps.

Resistance to halos can be controlled by the depth map radius filter option.

It also possible to adjust the amount of smoothing applied to the depth map.

Wavelet

This is an algorithm that can work wonders in low contrast or high overlap images, but will increase noise and may generated artefacts when there are sharp luminance transitions.

The wavelet algorithm can work with images out of order, but the image alignment may suffer. Ideally you should have the images sorted back to front or front to back, even if it’s not compulsory for that algorithm.

It is based on Complex Wavelets for Extended Depth-of-Field: A New Method for the Fusion of Multichannel Microscopy Images by B. Forster, D. Van De Ville, J. Berent, D. Sage and M. Unser. Image alignment is performed with the use of Parametric Image Alignment Using Enhanced Correlation Coefficient Maximization by G. Evangelidis and E. Psarakis.

A special mention goes to Petteri Aimonen for his Fast and easy focus stacking project on GitHhub which got me started down that particular rabbit hole.

Retouching

Once the rendering has been completed with either algorithm, you can use the retouching tool in FocusFusion. This allows to manually adjust the final image.

The retouch tool works by cloning from a source image into the final image. Just select the image in the left list, and clic/drag in the right image to clone.
You can adjust the size, hardness and opacity of the clone brush.

While the image is displayed in 8 bits per pixel, the retouching and cloning is actually performed at 16 bits per pixel quality.

Recommendations

Ideal results can be obtained when shooting from a tripod with focus bracketing. A macro rail will work as well if you have one. Exposure and contrast should be kept constant for the whole stack.

The images should be presented to FocusFusion ordered front to back or back to front, as this ensures the best alignment quality.