Introduction to Stacking

The easiest way to Stack a set of Frames is to use the Do Stack Standard Macro.   But if this does not perform well for you, you may need to work step by step down the Stack menu, at least until you find a method that meets your requirements.   Then you can program a Macro of your own to do it.

Here is a summary of the Stack menu Commands:-

   Stack->Reverse Order - Use if the top frame should be at the bottom etc.   Once detail has been found from a stack, gaps must be filled in by extending this in some way, but what is to be done around the edges if there is no detail there?   The method that CZ adopts to fill these gaps is to assume there is detail out of sight over the edge and that this is on the bottom Frame in the Stack.   Hence the need to have the Stack the right way up.

   Stack->Choose Frames to Use - Normally All Frames, the default.   Most new frames you generate are flagged as Unused by an '*' on the Title Line so that various functions will ignore them.   But if your intention is to have functions like 'Find Detail' use them, here is your opportunity.

Stack->Balance Colour and Brightness 
Stack->Size and Alignment
These two subjects are covered in Preparation of the Frames for Stacking.

   Stack->Replace Groups - Reduces number of frames.   Taking a lot of pictures either in groups at each focus level, or at small intervals produces an 'Over Sampled' stack.   There are two problems with using such a stack in CZ.   The more frames you have, the greater the chance that there will be a noisy pixel at a given location.   This will be picked up as detail and will of course be an error.   Also, because of the smallness of the steps in size etc., the automatic functions may not notice the slight change in size between frames and they may fail.   But there are advantages to taking extra shots, especially with low contrast subjects or poor lighting conditions.   In both of these situations noise starts to rear its ugly head.   By combining groups of frames and taking the average, CombineZ can reduce the effect of noise, and make the step in size between frames more manageable.   The single parameter is the number of frames to average together in each group.   It makes sense to use a factor of the original number which is initially displayed.

   Stack->Detail->Find Detail - Replaces what was 'Edge' in earlier versions of CombineZ.   You'll get dots, lines, and small patches, each marking places where the best focus Frame could be clearly identified.   This is the first stage in obtaining a Picture from a stack of Frames.   Notice the capital 'P' on Picture.   This word has special significance for CZ.   It is an object produced from a Stack by finding infocus points from the Frames that form the Stack, one for each point in the Picture.   The Frame from which each point comes is stored in another object called a Depthmap.   To view the Depthmap corresponding to a given Picture, press 'D'; to get back to the Picture press 'D' again.   Back to 'Find Detail', this function takes a single parameter; the lower its value the more Detail is selected, the Higher its value the less.   You might say "Why not just set it to zero and find everything that's there?"   I wish life were that simple.   Too high a value and you will obviously find nothing.   Too low a value and two problems occur.   First, noise starts to spoil things; you get random pixels appearing from the wrong frames.   Second, when something goes out of focus it starts to spread, often into regions where there should be no detail.   If you make the detail test too sensitive, this 'False Detail' will be picked up because there is no way the program can tell the imposter from the genuine article.   See below for how to manually edit the depthmap.

    Stack->Detail->Patchwork - this is an alternative to the last function, it looks for detail in a similar way but using variable sized patches spaced at regular intervals with a narrow gap between.   It is good when Find Detail fails to detect subtle details near a steep step in the Depthmap, Find Detail tends to smooth these steps.  One parameter controls the patch size and the other a threshold value, patches that differ from their neighbours by lass than this value are ignored.   Once this has been used it is easy to remove erronious patches by hand.

    Stack->Detail->Light and Dark - This function works by looking at the vertical column of pixels at one location, one from each Frame.   The Average Brightness, the Brightest and the Darkest pixels are found.   Then the pixel which is the most different from the average is the one used in the picture.   The single parameter is a Threshold value.   This function in conjunction with one of the last too can reduce the number of 'holes' in bristles etc. these arize because there is something under the bristle which comes into focus further down the stack and which has stronger detail.

   Stack->Fill Gaps - Uses 'Depthflow' method, partially replaces 'Despeckle'.   Once you have some good starting points in your Depthmap, either from manually seeding it or using 'Find Detail', the time has come to put some flesh on the bones.   Imagine a skin or an elastic membrane stretched over a set of posts of different heights, fastened down to the shorter ones of course, and anchored to the ground just outside the edges of your picture.   The height of each post corresponds to the Frame from which each point on the Depthmap comes.   'Fill Gaps' creates this imaginary membrane and uses its height at each point to assign a value to the Depthmap.   Once you have a complete Depthmap, the computer uses its entries to find the Frame from which each Pixel in the Picture should come, gets a copy of that Pixel from tthat Frame, and places it in the correct place on the Picture.   Notice that the Depthmap is not necessarily a faithful representation of the shape of the objects in your scene, it is rather the best values that produce a realistic Picture.   Imagine a near object viewed against a distant background.   The near object is in sharp focus in one Frame and the background in the second, of this two Frame Stack.   For a faithful Depthmap, the background Frame should extend right up to the edge of the foreground object.   But in the real world, if you allowed this to happen the background next to the foreground object would have some out of focus foreground mixed with it, because of the spreading effect mentioned above.   The only solution is to forsake some clarity around foreground objects to improve the appearance of the finished Picture.

   Stack->Remove Islands - Removes small patches due to noise.   This function takes a single parameter which is the minimum number of pixels an 'Island' is allowed to have and remain.    An Island is a patch of pixels from one Frame completely surrounded by patches from other Frames.   Small Islands often result from noisy pixels, after Fill Gaps has had its way with them.   They also crop up when reflecting or refracting parts of the scene focus or defocus the light source, and when False Detail, see above, is included.

   Stack->Remove Colour Steps  -  These often occur where patches from different frames meet.   Some times this function makes matters worse, but it is useful if you have say a bright yellow flower against a dark background.   False Detail causes double edges which this function may remove.   Failing that, manual editing is necessary.

   Stack->Interpolated Output  -   Actually the Depthmap has a higher resolution than just frame numbers, it stores intermediate values say 1.5 for a point that is halfway between frames 1 and 2.   In this example Interpolated Output would mix the values of the pixel on frames 1 and 2 together in a 50/50 ratio.   A similar mixing is done with other intermediate depthmap values.   You sometimes get jagged or sharp edges.   This function can soften them.   It also lessens some more subtle artifacts at the expense of a slight softening.   The output from this function goes into another area which I have not mentioned yet: 'Out'.   It is sort of an intermediate working area.   Computer programmers might call it an accumulator.   You can switch between a view of it and the Active Frame by pressing 'O', and between it and the Picture by pressing 'Tab' and 'O' alternately.   Thus you can see the effect of Interpolated Output and other functions such as 'Contrast', 'Colour and Brightness' and the various filters.   If there are Unused Frames, marked with an '*' at the top of the Stack, they are ignored by this function so you may need to make them Used in some cases.   Unused Frames that come between Used ones ARE used by this function.

   Stack->Horizontal Skew - This special purpose function 'Skews' the whole stack sideways, the parameter indicates the number of pixels the top frame will be moved relative to the bottom.   Intermediate Frames are moved by progressively lower amounts, the bottom Frame is not moved at all.   10000 is no skew lower values skew left and higher values right.   This function can be used to generate sterio pairs of images and 'rocking' animations.