Home  ::  Gallery  ::  Observatory Tour  ::  Resources  ::  Downloads  ::  Contact  ::  

Image Stacking and Blending

John A McCubbin

Principles

  1. Very short exposures result in very poor signal to noise ratio and very poor image depth
  2. Medium length exposures result in usable signal to noise ratio and usable image depth
  3. Medium length exposures prevent star blooming and require only medium length dark frames
  4. Very long exposures require very long dark frames and result in star blooming
  5. Stacking is indicated for dim objects with low to medium pixel saturaton levels
  6. Blending is indicated for bright objects with high pixel saturation levels

Background

Why do CCD imagers stack exposures? In one phrase, to minimize noise in the image. While it is almost impossible to eliminate all noise, it is possible to reduce it to a minimum and produce a high quality image from several medium length exposures. Very short exposures are the most common imaging mistake made by newcomers to CCD imaging. Taking a 4 second exposure of a globular cluster will yield a usable image, but with poor image depth. Image depth, as I define it, is the range of brightness values represented in an image.

Since a computer monitor can only display around 64 shades of gray, or color, then why do you need over 64 levels of brightness? The answer is that the 64 levels of gray or color you display may be in the arms of a galaxy or the medium brightness stars in a globular cluster. Having an image that will nearly max out the possible range of a 16 bit image (64,000 levels of gray) gives you the maximum number of options in image processing. An image with only 64 levels of gray can't be manipulated without serious degradation in the image quality. Short exposures also suffer from speckling of the image. That speckling is noise, or uneven pixel response, that can't be dark framed or flat fielded away. Figure one shows a good example of noise in an image.

 
Example 1
NGC 7635
Single 600 Sec Exposure
Shown 200% Size
  Example 2
NGC 7635
Six 600 Sec Exposures Stacked
Shown 200% Size

Figure 1

The noise is readily evident as a granular look to the area of nebulosity near the bubble. Even the area of the bubble looks granular. This is because the range of brightnesses in that area of nebulosity is represented by a narrow range of brightess values.

Medium length exposures are at least 10 minutes at f/10 and full resolution, or at least 5 binned 2x2. I consider that the minimum, and personally prefer even longer ones. The image at left was imaged at f/9, binned 2x2, through a refractor. For this object, I felt the 10 minute exposure time was the minimum for capturing nebular detail. In example two you can see the dramatic reduction of noise when the six, 10 minute exposures were stacked. Look at that same area of nebulosity near the bubble and not only can you see more detail and variation of the nebulosity, but it looks less granular.

The bubble nebula is a dim deep sky object and lends itself to stacking because a 10 minute exposure yields a range of values that are far from the 64,000 that would maximize the image depth of a 16 bit image. Star saturation (levels greater than 64,000) isn't considered important, unless you're doing photometry, so the important parts of the image you want to capture are the nebulosity and detail within. Those "important parts" of the single 10 minute exposure only yielded a range of brightness from a sky background level of 25 to 1588 in the brightest parts of the nebula. When six of these were stacked by adding them together the image depth had a range of nearly 10,000 ranges of brightness . This allows the more important ranges of the images to be stretched linearly or nonlinearly resulting in a visually more pleasing image with the added benefit of dramatically reducing noise.

Blending images also reduces noise, but through a different method. If, for instance, you image a planet through a 3x barlow, a 0.15 sec exposure would yield a range of brightness from 0 to 55,000. Sequential images can't be added, because if you do, you will exceed the 64,000 levels of gray representable in a 16 bit image (MaxIm allows you to do this and rescales appropriately - but I don't use addition under these circumstances). To reduce noise you need to average images. This has the effect of halving the noise level if you blend, or average, two images. This is also VERY USEFUL with flat frames, as I will demonstrate.

 
Flat Frame Segment
Single 4 Sec Exposure
  Flat Frame Segment
8 Averaged 4 Sec Exposures

Figure 2

Looking at Figure 2, in the example on the left you see the obvious noise in the flat frame. If a CCD image were divided by the sensitivity of this flat frame, the result would be an increase in the grainy appearance of the CCD image. The flat frame on the right is an average of 8 flat frames taken under the exact circumstances as the one on the left. Notice the dramatic decrease in noise. The flat frame on the right yields a far superior image, with less noise.

Method of Stacking images by Mathematical Addition

I use MaxIm DL to add images, primarily because it is very easy to align images with subpixel accuracy. Your particular software may vary, so you may have to read your manual a little. It is very important that prior to stacking your images, they be dark subtracted and flat framed with a quality flat frame. Then before stacking them they must be critically aligned. This is the difficult part of image stacking, not the stacking itself.

First images must have the stars critically aligned. The advantage of taking sequential images the same night, without removing the camera, is that they will only require a simple x-y shift to align the images. Rotation is much more difficult, and I will not discuss it here. To align an image in the X-Y axes, first open both images. Choose from the menu, Process > Align . You will be presented with a dialogue box asking you to choose the images you wish to align. Choose all the images from the list then click on Okay. You will then be presented with an "alignment image" that is a copy of the first image on your list, so make sure that the first image on the list you chose is the image you want to align the others with. You will also see a dialogue box with a choice of modes. I use the Overlay mode, because this allows alignment to 0.25 pixel accuracy.

To align the next image on the list with the index image, or alignment image, click on the Next Image button. You will see a different set of stars of a different color appear. The four direction arrows will then become active. Choose the amount of step to Nudge the stars, and align them with the arrows until they are totally aligned. You may double check yourself by clicking the Previous Image button alternating with the Next Image button and watching the stars for movement. Repeat this for all the images on the list. When you have finished your last image, click the Okay button and alignment is complete.

To mathematically add the images, select the Process > Pixel Math menu choices. In the dialogue box you are presented with choose the first two images you want to add and make sure they are 100% scaled, with no added constant. Make sure Add is selected by selecting its radio button. Click Okay. Repeat this for each of the remaining images, adding the next image on the list to the original first image (the one that represents the stack of all the previously added images). Save the resultant image as the master stacked image and you are done.

Other software packages allow alignment and pixel math addtion, just the steps will be different.

Method of Averaging Images

I use CCDSoft for averaging images. The method is as follows. Open all the images, they should already be aligned, if necessary, using the above or similar method. Flat frames will not have to be aligned, so if you are making a master flat frame, skip that step. Select the Image > Combine menu choices. Select Blend from the drop down menu at the top. Select the two images you wish to blend from the drop down image lists.

Make sure that the percent is set at fifty percent. For this routine to work you must give each image equal weight. For that reason, you should use two, four, or eight, or sixteen as the number of images you use. If you have two images, average the two. If you have four, average the first two, then average the second two, then average the two averages. This insures that all images are of equal weight. With eight, just extend the process one more tier, sixteen requires one more level. This is very simple and straightforward in CCD soft. The resulting image will offer a dramatic reduction in noise levels.

With other software, such as CCDOPS, you can divide each image by two first, then add them together. This achieves the same effect, but isn't quite as simple.

You can use Photoshop to average (or overlay) images. The basic steps are to take the images put them into layers and align them with the free transform tool (reduce one to around 40% luminance to see the underlying stars for alignment). Once aligned, select the Overlay option at the drop down menu of the layers control box. It will average the images.

Planets respond very well to blending, alignment is a little more difficult and requires some experimentation, but in MaxIm the process is identical as that for deep sky objects. You do not, however, have stars to line up on, just the planetary features and the limb of the planet. Here I do a software switch. I use MaxIm to line the images up, save them, then switch to CCDSoft for blending.

Try these techniques out and your images will improve as the noise levels drop.

Back to Resources Page


I consider your heavens, the work of your fingers, the moon and the stars, which you have set in place ... Psalms 8:3

Copyright (C) 2005, Out of this World Productions, Hopkinsville, KY