If you are completely new to focus stacking, then perhaps it would be best to start by reading a couple of tutorials:
Otherwise, we’ll assume you already know the basics of focus stacking and have a stack of JPEG or TIFF images to work with.
Getting started with Zerene Stacker is easy:
Congratulations, you have now finished your first stack using Zerene Stacker!
Here’s an example — 167 frames of a tiny fruit fly, stacked into a halo-free composite, fully automatic, no messing with parameters.
From this point, there are several directions you may want to go. These include:
To get the most benefit from using Zerene Stacker, it’s important to understand the differences between its two major stacking methods.
PMax is a “pyramid” method. It is very good at finding and preserving detail even in low contrast or slightly blurred areas. It's also very good at handling overlapping structures like mats of hair and crisscrossing bristles, nicely avoiding the loss-of-detail halos typical of other stacking programs. But PMax tends to increase noise and contrast, and it can alter colors somewhat.
DMap is a “depth map” method. It does a better job keeping the original smoothness and colors, but it's not as good at finding and preserving detail.
The two methods complement each other. Some types of subjects look good when they are processed automatically by PMax, but not by DMap. Other subjects are just the opposite. For particularly challenging subjects like bugs and flowers shot through microscope objectives, neither method is ideal by itself. In that case the best results are obtained by using human judgment and the retouching tool to combine the best aspects of both algorithms.
With default settings, DMap processing is broken into three big steps:
Step 2 is illustrated below.
With the contrast threshold set at Percentile: 0.0, we can see a large amount of “junk” around the edge of the subject. In other subjects, we might see unacceptable “chunky” regions even in the body of the subject. This setting is too low:
With the contrast threshold set at Percentile: 85.0, the junk has mostly disappeared, but a lot of subject detail has disappeared also. This setting is too high:
With the contrast threshold set to an intermediate level, the junk has mostly disappeared, while most of the subject detail is still retained. This setting will give a good result:
When the threshold is set properly, click the OK button and wait for the computation to finish.
The DMap output from Percentile: 55.0 is shown below.
With this difficult subject, there is still some halo that must be dealt with by retouching. This can be done quickly and easily from a PMax output, as shown in the retouching tutorial.
For simpler subjects, DMap by itself with a carefully set threshold will often give final quality results.
DMap results are also affected by two parameters named Estimation Radius and Smoothing Radius, which can be set in Options > Preferences > DMap Settings. The best settings for these depend on the nature of your images. The default settings are appropriate for typical conditions. Subjects that have simple shapes and a lack of sharp detail will benefit from higher settings (larger radii), while subjects that have unusually crisp, high contrast detail may benefit from lower settings (smaller radii). Typically the smoothing radius should be about half the estimation radius. The very best values for these parameters must be determined by experiment, since they depend on many factors such as magnification, lighting, camera, and lens settings in addition to the type of subject. In particularly troublesome cases, it can be helpful to run DMap two or more times with different parameter settings, and combine those results with retouching.
Zerene Stacker’s retouching capability is one of its strongest features. You can quickly and easily merge the best aspects from two or more output stacked images, in addition to merging from individual source frames as commonly provided by other programs. The user interface also provides a tightly integrated set of navigation tools that let you quickly and easily move in depth through the stack, pan and zoom within the image, change brush size, and flash between source and retouched images in the same window.
These capabilities are best learned by watching our video tutorial, Introduction to Retouching.
But just in case you can’t watch the tutorial, here are the key points:
After you’ve seen that first retouching tutorial, then there’s a second one you should watch also: Advanced Retouching.
While the first video tutorial focuses on the basic operations of retouching, the second one goes into more depth about how to use these capabilities to get the best results from a more challenging stack of floral photography: close-up honeysuckle blossoms, shot in the wild and moving in a slight breeze.
Sometimes the easiest way to deal with a troublesome area is to stack just the input files with that area in focus, then use the retouching tool to merge that output image with an output image for the full stack.
To stack a subset of the input files, simply select (highlight) the files to be included, then Stack > Stack Selected (PMax or DMap). To add files to the selection set, use shift-click (select a range of files), control-click (add one file), and shift-control-click (add a range of files).
Stacking selected frames is a particularly convenient way of dealing with the “transparent foreground” artifact that commonly appears with deep high magnification stacks. The strategy is to do a Stack All first, identify places where the foreground appears transparent, then determine which frames have just that foreground in focus, Stack Selected those frames, and finally retouch from the Stack Selected output into the Stack All output. With a deep stack, this approach can be much faster and less tedious than retouching from individual source frames.
Using a “project” in Zerene Stacker lets you leave the program, get back in, and pick up working where you left off. The project contains links to the input images, alignment and brightness adjustments, and copies of the output images stored in a proprietary lossless format suitable for subsequent processing.
In the computer’s file system, each Zerene Stacker project consists of a directory of files, one of which has file type “.zsj”.
With default settings, new projects are initially created with a temporary name in a temporary location. Saving a project involves simply renaming the directory and .zsj file if possible, or copying if necessary. Other options and directory locations can be set under Options > Preferences > New Projects.
Zerene Stacker has a flexible batch facility for unattended execution.
Very briefly, a “batch” consists of a set of tasks to be performed for each of a set of projects or folders (directories) containing source images, combined with some options about how the results are to be saved.
In the following example, the user has defined one batch, consisting of 7 folders of source images. A new project will be constructed for each folder of source images, PMax and DMap will be run within each project, the projects will be saved in a designated location, and output images will be both retained within the projects and written to external files.
For batch usage, the appropriate contrast threshold for DMap is best determined by running a typical stack interactively. Then you can set Options > Preferences to apply that same threshold unattended to all folders in the batch.
Note that each task may have different options (preferences) set for it. The task records whatever Options > Preferences are in effect at the time the Add button is pressed.
The options for a task can be confirmed and/or changed by highlighting the task and pressing Change Options. Options can also be displayed in a textual form by highlighting a task and pressing Details.
In the Batch Queue dialog, the “Add Current Project” button has two different uses, as follows:
Similarly, the setting for disposition of output images to “Save in source folder” does different things depending on the target of the batch operation, as follows:
The batch capability can also be used to provide an API (Application Programming Interface) that allows Zerene Stacker to be controlled by another application such as ImageJ or a command script. For details, see, Batch API: Running Zerene Stacker From Another Application.
Options > Preferences… brings up this dialog. Categories of options can be selected in the list on the left, with corresponding settings changed in the panels on the right. Tooltips are provided throughout, to explain what each of the options does.
Except when retouching, you have complete control over the size and placement of the image windows. Each image window can be minimized or maximized (within the overall bounds of the frame) by clicking on the little icons in the upper right corner: . When a window is maximized, it can be restored to partially fill the frame by clicking a similar icon that appears in the same place: . Images can be resized and moved by dragging their edges and title bars.
When the program starts, it used the same layout it had the last time it ended.
If you lose track of windows, you can always select Options > Restore Default Layout to make things sane again.
A unique feature of Zerene Stacker is its ability to generate stereo and 3-D rocking sequences from a single stack, even when the subject is hairy, bristly, or has complex geometry with overlapping parts. This capability is described in its own documentation page, Synthetic Stereo.