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.
| Frames | Total exposure | Signal to noise compared with one frame |
|---|---|---|
| 1 | 1 minute | 1 times |
| 4 | 4 minutes | 2 times |
| 9 | 9 minutes | 3 times |
| 16 | 16 minutes | 4 times |
| 25 | 25 minutes | 5 times |
| 100 | 100 minutes | 10 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.
| Frame | How to take it | What it records | How important for beginners |
|---|---|---|---|
| Dark | Lens cap on, with the same exposure time, ISO and temperature as the lights | The heat noise and hot pixels of the sensor | Useful, especially for long exposures on warm nights |
| Flat | An evenly lit surface, such as a white t-shirt over the lens under an even light | Vignetting and dust spots | The most important of the three |
| Bias | The shortest exposure the camera allows, with the cap on | The electronic offset of the sensor | A 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
| Method | What it does | When to use it |
|---|---|---|
| Average (mean) | Adds up the frames and divides, which gives the best signal to noise ratio | The usual final step |
| Median | Takes the middle value of each pixel | A robust choice with few frames, though it keeps less signal |
| Sigma clipping | Rejects pixels that differ greatly from the rest, such as satellite trails, then averages the rest | The best general choice for deep sky images |
| Lighten | Keeps the brightest value of each pixel | Star trails, as described in star trails the easy way |
Software that does the work
| Program | Runs on | Cost | Good for |
|---|---|---|---|
| Siril | Windows, macOS and Linux | Free | Deep sky stacking and processing |
| DeepSkyStacker | Windows | Free | A simple route from frames to a stacked image |
| Sequator | Windows | Free | Starry landscapes with a foreground |
| PixInsight | Windows, macOS and Linux | Paid | Advanced processing |
| Astro Pixel Processor | Windows, macOS and Linux | Paid | Stacking 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.
- 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.
- 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.
- Load them into a stacking program. Open the lights and the calibration frames in free software such as Siril or DeepSkyStacker.
- Align and reject outliers. Let the program align the stars and reject odd pixels, such as the trails of satellites and aircraft.
- Combine the frames. Stack with an average or a sigma clipping method to build the clean result.
- 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
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.
