Darks, Flats and Bias Frames: What They Fix

A plain explanation of calibration frames: what each one removes, how many you need, and when shooting them is a waste of a clear night.

Every astrophotography tutorial tells you to shoot darks, flats and bias frames. Almost none of them tell you what each one removes, which means most people either shoot all three out of superstition or skip all three out of confusion. Both are mistakes, and not equally bad. One of the three matters far more than the other two, and it is not the one beginners usually start with.

Three errors in every frame

A camera sensor does not report the light that fell on it. It reports the light that fell on it, plus a set of errors, and each calibration frame targets one specific error.

It adds heat. Every pixel accumulates charge from thermal energy even in total darkness, and it does so at a rate that roughly doubles for every 6-7 °C. Over a 300-second exposure that adds up to a real signal that has nothing to do with the sky. The rate also varies from pixel to pixel. Some pixels are much hotter than their neighbors, which is where those colored speckles come from.

It vignettes and collects dust. Your optics deliver more light to the center of the frame than the corners, usually by 20-40%. Dust on the sensor window or filter casts soft gray doughnuts. Neither is in the sky, but both are in every frame.

It has an offset. The camera adds a fixed pedestal to every reading so that noise never clips at zero. That pedestal is not perfectly uniform either. It has faint patterns in it.

Darks fix the first. Flats fix the second. Bias fixes the third.

Flats are the ones that matter

If you only ever shoot one kind of calibration frame, shoot flats. Most people do the opposite, and it is the biggest quality gain available to a beginner.

The reason is that vignetting and dust shadows are multiplicative and large. A 30% falloff darkens the corners, and it also survives stretching, which amplifies it. When you pull faint nebulosity out of the background, you also pull out the vignette, and you end up with a bright blob in the middle of your frame that no amount of gradient removal fully fixes. Dust doughnuts do the same thing: they appear as soft dark rings right where you are trying to see faint signal.

Darks, by contrast, address something that stacking already partly handles. Average enough frames and random thermal noise falls as the square root of the count. Hot pixels do not average away, but they can be dealt with statistically, which I will come back to.

Flats are also the easiest to shoot and the least demanding of your clear-sky time. You do not need darkness. Point the telescope at a uniformly lit surface (twilight sky, a white t-shirt over the aperture with a lamp behind it, a tablet showing a white screen) and expose so the histogram sits around a third to half of full scale. Twenty to thirty frames is plenty.

The one rule: flats must be shot at the same focus, same rotation and same optical configuration as your lights. If you refocus or rotate the camera, the dust moves relative to the frame and your flats are worse than useless, because they stamp doughnuts in the wrong places. Shoot them at the end of the session before you touch anything.

Darks: useful, but overrated for short exposures

A dark frame is an exposure with the shutter closed, at the same duration, temperature and gain as your lights. Subtract it, and you remove both the average thermal signal and the fixed pattern of which pixels are hotter than others.

Two conditions make darks worth shooting:

  • Long exposures. At 300 seconds the thermal contribution is substantial. At 10 seconds, which is what a Seestar or a Dwarf shoots, it is often below the read noise, and subtracting it buys you very little.
  • A cooled camera. Darks only work if the temperature matches. A dedicated astro camera at −10 °C produces repeatable darks you can reuse for months. A DSLR that started the night at 18 °C and finished at 4 °C does not. The dark you shot at the end does not describe the frame you shot at the start.

That last point is the one that trips people up. An uncooled DSLR’s dark current changes through the night as the camera cools. Subtracting a mismatched dark can add noise rather than remove it, because you are subtracting one noisy frame from another and the thermal signal does not even cancel properly.

If you shoot with an uncooled camera in short subs, it is entirely reasonable to skip darks. It is not laziness. The correction does not apply cleanly to your data.

Bias: the one you can usually ignore

A bias frame is the shortest exposure your camera can take, with the shutter closed. It captures the electronic offset and nothing else.

Bias frames matter when you are scaling darks, that is, using a library dark shot at a different exposure length and mathematically adjusting it. That requires separating the fixed offset from the time-dependent thermal signal, which is what bias gives you.

If you shoot matched darks at the same length as your lights, the bias is already inside the dark, and subtracting the dark subtracts the bias with it. Shooting bias separately then adds nothing.

Bias frames are cheap (a hundred of them takes under a minute), so there is no strong argument against having them. But if you are standing in the cold wondering whether to bother, this is the one to skip.

Hot pixels

This is where the standard advice falls short. Darks remove the hot pixels your sensor produces predictably. They do not remove cosmic ray hits, which land in one frame at random, and they do nothing at all for the very large number of people who never shoot darks.

Hot pixels are worth taking seriously because stacking does not remove them. Average ninety frames that all have a hot pixel at (1204, 883) and you get a stack with a hot pixel at (1204, 883). Then registration rotates the field between frames and smears that stationary defect into a short colored streak, which makes an otherwise good image look amateurish.

They can be found statistically instead. The trick is telling a defect from a star, since both are small and bright. The discriminator is that a star is not one pixel. Optics spread a point source across several, so a real star has bright neighbors. A hot pixel stands alone. Compare each pixel against the median of its eight neighbors, and scale the threshold by how much those neighbors disagree with each other. Around a hot pixel on flat sky they agree closely. Around a star’s core they are the star’s own shoulders and vary a lot. That distinction is what lets you remove one and keep the other.

Akastroid does this automatically on every frame, before registration, whether or not you shot darks. It is deliberately conservative, eight sigma out, because the costs are asymmetric. A missed hot pixel is a speck. A removed star core is data nothing can recover.

A practical answer

If you have limited time and cold hands:

  1. Always shoot flats. Twenty to thirty, at the end of the session, before you touch focus. This is the biggest win.
  2. Shoot darks if your camera is cooled or your subs are long. Match the temperature, gain and duration. Twenty is a reasonable number.
  3. Shoot bias if you are building a dark library. Otherwise it is optional.
  4. Do not lose a clear night to calibration. Lights are the irreplaceable part. Flats can be shot at dawn, darks with the lens cap on indoors.

And if you have no calibration frames at all, process anyway. A stack of uncalibrated lights with a gradient removed and its hot pixels cleaned is a real photograph.

Also in Čeština · Dansk · Deutsch · Ελληνικά · Español · Suomi · Français · Hrvatski · Magyar · Italiano · 日本語 · Norsk bokmål · Nederlands · Português (Brasil) · Română · Slovenčina · Slovenščina · Srpski · Svenska · Українська · 繁體中文

Try it on your own data

Akastroid runs its processing on your own frames and logs each step it took.

Download Akastroid