Key takeaways

  • The signal from a faint object is the same in every frame, while the noise is random, so averaging many frames lets the noise cancel.
  • The signal to noise ratio grows with the square root of the number of frames: 4 frames give twice the quality, 100 frames give ten times.
  • Flat frames are the most important calibration frames for beginners, because they cure vignetting and dust spots.
  • Do not chase the perfect single frame. Keep stars sharp, keep the background away from the bright end of the histogram, and keep collecting.

Stacking works because the faint light of an object is the same in every frame, while the noise is random. Averaging many frames improves the signal to noise ratio by the square root of their number, so a hundred frames give ten times the quality of a single one.

If you photograph a faint nebula for the first time, the result on the back of the camera is likely to be disappointing: a dark picture, grainy and speckled, with a hint of colour. The surprise is that this is normal. The technique that turns it into a clean, detailed picture is called stacking, and it is built on a little piece of mathematics.

Signal and noise

Every frame contains the faint light of the object, which is the signal, and a random scatter of brightness from the sensor and the sky, which is the noise. The signal is the same in every frame, while the noise differs from frame to frame. When you average many frames, the signal stays where it is, but the random noise partly cancels out.

The improvement follows a square root rule. The signal to noise ratio grows with the square root of the number of frames.

The square root rule in numbers (frames of 60 seconds each)
FramesTotal exposureSignal to noise compared with one frame
11 minute1 times
44 minutes2 times
99 minutes3 times
1616 minutes4 times
2525 minutes5 times
100100 minutes10 times

That also explains the cost: to double the quality again, you need four times the frames. It is why dedicated photographers spend several hours on a single target, and why a bright sky needs more total time to reach the same result, as discussed in our article on the Bortle scale.

Four times the frames buys you twice the quality, which is why patience is the real equipment.

Calibration frames

Besides the pictures of the sky, which are called light frames, stacking programs use three kinds of calibration frames to remove predictable defects.

The three kinds of calibration frames
FrameHow to take itWhat it recordsHow important for beginners
DarkLens cap on, with the same exposure time, ISO and temperature as the lightsThe heat noise and hot pixels of the sensorUseful, especially for long exposures on warm nights
FlatAn evenly lit surface, such as a white t-shirt over the lens under an even lightVignetting and dust spotsThe most important of the three
BiasThe shortest exposure the camera allows, with the cap onThe electronic offset of the sensorA refinement, and often optional

Flats are the most important for beginners, since vignetting is the most common visible fault, as described in our article on reading a test frame.

Dithering and other small kindnesses

If the camera points at exactly the same spot in every frame, the fixed noise pattern of the sensor will stay in the same place and can build into faint streaks. Moving the camera by a few pixels between frames, a practice called dithering, spreads the pattern so that stacking can wipe it away.

Ways to combine the frames

Common stacking methods
MethodWhat it doesWhen to use it
Average (mean)Adds up the frames and divides, which gives the best signal to noise ratioThe usual final step
MedianTakes the middle value of each pixelA robust choice with few frames, though it keeps less signal
Sigma clippingRejects pixels that differ greatly from the rest, such as satellite trails, then averages the restThe best general choice for deep sky images
LightenKeeps the brightest value of each pixelStar trails, as described in star trails the easy way

Software that does the work

Some programs for stacking
ProgramRuns onCostGood for
SirilWindows, macOS and LinuxFreeDeep sky stacking and processing
DeepSkyStackerWindowsFreeA simple route from frames to a stacked image
SequatorWindowsFreeStarry landscapes with a foreground
PixInsightWindows, macOS and LinuxPaidAdvanced processing
Astro Pixel ProcessorWindows, macOS and LinuxPaidStacking large projects

What to do about it tonight

Do not chase the perfect single frame. Choose exposures that keep stars sharp and the background well away from the bright end of the histogram, and then simply keep going. Collect more frames on a good night, add more on the next one, and combine them all. Here is the whole routine.

  1. Shoot the light frames. Take as many exposures of your target as you can, with sharp stars and a background well away from the bright end of the histogram.
  2. Shoot the calibration frames. Take flat frames of an evenly lit surface, and, if you like, dark frames with the cap on and bias frames at the shortest exposure.
  3. Load them into a stacking program. Open the lights and the calibration frames in free software such as Siril or DeepSkyStacker.
  4. Align and reject outliers. Let the program align the stars and reject odd pixels, such as the trails of satellites and aircraft.
  5. Combine the frames. Stack with an average or a sigma clipping method to build the clean result.
  6. Stretch and adjust. Bring out the faint detail with contrast and colour adjustments.

In AstroNight you can note the number of frames for every session, so you can see how the total grows over the months.

Frequently asked questions

How many frames do I need to stack?

As many as you can take. A few dozen frames make a visible improvement, and a faint nebula usually wants hundreds, which means a few hours of total exposure. Because the signal to noise ratio grows with the square root of the number of frames, each doubling of quality needs four times as many.

Do I need dark, flat and bias frames?

Flat frames matter most, since they cure vignetting and dust spots. Dark frames help on long exposures and warm nights, and bias frames are a refinement. A stack without any of them is still much better than a single frame.

What is dithering in astrophotography?

It is moving the camera by a few pixels between frames. This spreads the fixed noise pattern of the sensor around, so stacking can remove it instead of building it into faint streaks.

Does stacking work with phone photos?

Yes. The night modes of recent phones combine several short frames automatically, which is a quick version of the same idea. For a faint target you can also stack many frames yourself on a computer.

What is the best software for stacking astrophotos?

Siril and DeepSkyStacker are free and capable, and Sequator is a good free choice for starry landscapes. Paid programs such as PixInsight and Astro Pixel Processor add advanced tools for larger projects.

Sources and further reading

  1. Signal-to-noise ratio (Wikipedia)
  2. Dark-frame subtraction (Wikipedia)
  3. Flat-field correction (Wikipedia)
  • stacking
  • signal to noise
  • calibration frames
  • dark frames
  • flat frames
  • dithering

AstroNight is now on the App Store. The free planner and coach for astrophotography works on iPhone and iPad with iOS 17 or later, offline, with no account. Get it on the App Store.