Astrophotography Calibration Frames: Preprocessing Explained for Beginners
Andromeda Galaxy stacked from calibrated frames

Astrophotography Calibration Frames: Preprocessing Explained for Beginners

Calibration frames — darks, flats and bias — remove your camera's own errors for cleaner images. A beginner's guide to astrophotography calibration frames.

Astrophotography calibration frames are photos of your camera's own errors — taken with the cap on or aimed at a blank light source — that preprocessing software subtracts from your images. Together with stacking, this is how dozens of noisy, blotchy raw exposures become one clean picture. No deep-sky photo you have ever admired skipped this step.

Here is the thing nobody tells beginners: the image that comes out of your camera at the telescope is not the picture. It is raw material. Every finished deep-sky photo you have seen — including every image on this site — went through a hidden factory stage called preprocessing, where calibration frames strip out the camera's built-in defects and stacking averages away the noise. If you have no idea what dark frames, flat frames, or bias frames are, or why anyone would photograph the inside of a lens cap, this 2026 guide is for you. By the end you will know exactly what these strange files do and how dramatically they change your final image.

What is preprocessing in astrophotography?

Preprocessing is everything that happens to your photos between the telescope and the artistic work: removing the camera's built-in errors with calibration frames, then aligning and averaging all your exposures into a single clean image (stacking). It is stage two of the three-stage pipeline every deep-sky image goes through.

  1. Capture — at the telescope, you shoot dozens of exposures of your target. These are called light frames. Skills like polar alignment and autoguiding live here.
  2. Preprocessing — at the computer, software removes the predictable errors using calibration frames, then stacks everything into one deep image. Mechanical, repeatable, and almost fully automatic.
  3. Post-processing — the creative stage: stretching the faint signal into view, adjusting colour and contrast, sharpening detail.

The single most important thing to understand: a deep-sky image is not one photograph. It is typically 20 to 200 photographs, cleaned up and combined. When someone says their Andromeda image is "four hours of exposure," they mean the combined total of many individual frames, all merged during preprocessing. Skip or botch this stage and no amount of editing skill can save the result — the errors get baked in.

Why a raw light frame looks so bad

Open a single raw exposure of a nebula and you will mostly see a grainy, orange-grey wash with a few stars. The nebula is in there — but it is one of the faintest things in the frame. Here is what your camera actually recorded, from strongest to weakest:

  • Sky glow — light pollution and natural airglow, brighter than most deep-sky targets.
  • Thermal signal — a sensor is an electronic device that warms up, and warmth generates false brightness even in total darkness. It grows with exposure time and temperature.
  • Hot pixels — individual pixels that misfire and read far too bright, showing up as vivid red, green, and blue specks scattered across the frame.
  • Vignetting — your optics deliver less light to the corners than the centre, so the edges of every frame are darker.
  • Dust shadows — specks of dust on the sensor window or filters cast out-of-focus shadows that look like translucent doughnuts.
  • Read noise — a small burst of electronic static added every time the sensor is read out.
  • Your target — the faint whisper of real signal underneath all of the above.

Post-processing will eventually stretch the image — massively amplify the faint end to bring the nebula out. But stretching amplifies everything: every hot pixel, every dust doughnut, every darkened corner gets magnified along with the target. That is why the errors must be removed first, while they are still small and predictable. That removal is exactly what calibration frames are for.

What are calibration frames in astrophotography?

Calibration frames are photographs of your equipment's errors, taken deliberately, with the sky removed from the equation. Think of a kitchen scale: to weigh flour accurately, you first weigh the empty bowl and subtract it. Calibration frames are astrophotography's empty bowl — each type isolates one error so software can subtract it from every light frame.

The trick that makes this possible is that these errors are repeatable. The same hot pixels fire in every exposure. The same corners darken. The same dust casts the same shadows. Photograph the error once, and you can remove it everywhere. There are four types:

Frame typeThe error it photographsHow you shoot it
Dark frameThermal signal and hot pixelsCap on the telescope; same exposure time, ISO/gain, and temperature as your lights
Flat frameVignetting and dust shadowsAim at an evenly lit blank surface; same focus and camera rotation as your lights
Bias frameRead noise from the electronicsCap on; fastest possible shutter speed, same ISO/gain
Dark flatThermal signal inside your flat framesCap on; same exposure time and gain as your flats

None of them contain the sky. A dark frame is a photo of blackness. A flat frame is a photo of nothing but even light. That is the point: with no stars in the way, the only thing left in the frame is the error itself.

Dark frames: your camera's heat, photographed

Put the cap on the telescope and take an exposure with the exact same settings as your light frames. Logically the result should be pure black — no light reached the sensor. Instead you get this:

A raw CCD dark frame full of hot pixels and thermal noise
A real dark frame — a photo taken in complete darkness. Every white speck is a hot pixel or thermal signal, not a star. All of this is hiding inside your sky photos too. Credit: H. Raab, Johannes Kepler Observatory, CC BY-SA 3.0.

Every one of those specks is also present in every photo you took of the sky that night, silently posing as stars. Without dark subtraction, your final image ends up peppered with coloured confetti, and some of it survives stacking to masquerade as detail. Because thermal signal roughly doubles with every 6 °C of warming, dark frames must match your lights in temperature as well as settings — shoot them right after your session with a DSLR, or reuse a stored library with a temperature-regulated cooled camera. On my remote rig in Chile, the camera cools to the same set point every night, so one library of darks, refreshed every few months, calibrates months of imaging.

Flat frames: a map of your dirty window

If you photograph a perfectly even white surface through your telescope, the picture should come back perfectly even. It never does — and the ways it fails are a complete map of your optical path's flaws:

A flat frame revealing vignetting and dark dust mote shadows
A real flat frame — a photo of nothing but even light. The dark corners are vignetting; every dark blob is the shadow of a dust speck. This map lets software cancel both. Credit: H. Raab, Johannes Kepler Observatory, CC BY-SA 3.0.

This is the dirty-window principle: you cannot clean the view, but if you know exactly where the dirt is, you can correct for it mathematically. Without flat-field correction, stretching turns mild corner darkening into heavy black vignettes and invisible dust shadows into glaring doughnuts stamped across your nebula. Flats are shot in minutes at the end of a session — an LED panel laid over the telescope, or a white T-shirt stretched over the aperture and aimed at the twilight sky — with one golden rule: nothing in the optical train may change first. Same focus, same camera rotation, same filters. Rotate the camera before shooting flats and the dust map no longer lines up with your images.

Bias frames and dark flats

Bias frames capture the smallest error: the faint electronic static the sensor adds simply by being read out. They cost almost nothing — cap on, fastest shutter speed your camera has, fifty of them in under two minutes — and they let the software combine the other calibration frames with the correct arithmetic.

Dark flats are dark frames matched to your flats instead of your lights, and on modern cooled CMOS cameras they usually replace bias frames entirely, because many CMOS sensors misbehave at the ultra-short exposures bias frames need. The 2026 rule of thumb: DSLR or CCD camera, shoot bias; cooled CMOS camera, shoot dark flats instead.

How calibration frames are applied

You never apply calibration frames by hand — stacking software does it — but knowing what happens demystifies the whole process. It works in two moves:

Move one: build the masters. A single dark frame contains random noise of its own, so the software first averages your 20–30 darks into one smooth master dark — a clean, trustworthy portrait of the thermal error. It does the same for flats and bias frames. This is why you shoot calibration frames in batches: averaging many measurements of the same error gives a far more accurate map of it.

Move two: correct every light frame, pixel by pixel. For each of your sky photos, the software subtracts the master dark (removing thermal signal and hot pixels) and then divides by the master flat (brightening the vignetted corners back up and lifting the dust shadows away). Subtraction removes signal that was falsely added; division corrects light that was unevenly lost. In one line: calibrated image = (light frame − master dark) ÷ master flat.

That single line of arithmetic, applied to millions of pixels across every frame, is the entire secret. Your part is simply shooting the calibration frames and tagging them correctly in the software — darks in the darks slot, flats in the flats slot — and the pipeline runs itself.

How to stack images for astrophotography

To stack images for astrophotography, software aligns the stars in all your calibrated frames and averages them into one image — and this is where the noise finally dies. Calibration removed the repeatable errors; stacking attacks the random ones. Each exposure carries a different random sprinkle of grain, so when you average 30 frames — say thirty 120-second shots of the Wizard Nebula — the grain cancels itself out while the nebula, identical in every frame, stays firm. Record a faint whisper fifty times and the hiss averages away; the whisper remains.

Two steps happen under the hood. Registration: the software finds star patterns in each frame and shifts and rotates every image until the stars line up perfectly — no exposure points at exactly the same pixel twice. Integration: the aligned frames are averaged with a rejection rule (usually called sigma clipping) that discards anything appearing in only one frame — satellite trails, aircraft, cosmic-ray hits — automatically.

The payoff follows a square-root law: 4 frames are twice as clean as one, 16 frames four times, 100 frames ten times. This is why astrophotographers obsess over total integration time rather than any single exposure, and why the right length for each individual sub-exposure is worth calculating with our astrophotography calculator.

The impact on your final image

Put the whole pipeline together and the difference is not subtle. Skip preprocessing, stretch a single raw frame, and you get a grainy orange wash with black corners, doughnut shadows, and coloured speckles everywhere — the classic disappointing first attempt. Calibrate and stack the same night's data and the background turns smooth and neutral, the corners match the centre, the specks vanish, and faint outer nebulosity you could not see at all becomes real, workable signal.

The featured image of this article makes the point: that Andromeda Galaxy shot was taken without a telescope — an ordinary camera and lens — then calibrated and stacked in free software. Modest data, properly preprocessed, beats great data processed badly. A calibrated 30-frame stack will outperform an uncalibrated 100-frame stack nearly every time, because stacking can only average away random noise — it makes repeatable errors like hot pixels and vignetting stronger, not weaker.

How many calibration frames do you need?

Take 20–30 darks, 20–30 flats, and 50–100 bias frames (or 20–30 dark flats). Beyond that, improvement fades fast — master-frame quality also follows the square-root law — and clear-sky time is better spent shooting more light frames.

Calibration frameBare minimumSweet spotSky time cost
Darks1020–30None — cap on, even indoors for cooled cameras
Flats1020–30Minutes at dusk or dawn
Bias2550–100Under two minutes, any time
Dark flats1020–30None — cap on, matches flat exposure

Software that does all of this for you

Every program below builds the masters, calibrates, registers, and integrates automatically once you tag your files. The free ones are genuinely good:

  • DeepSkyStacker (free, Windows) — the classic beginner choice; four file lists and one button.
  • Siril (free, Windows/Mac/Linux) — more powerful, with one-click scripted preprocessing.
  • Sequator (free, Windows) — simplest for untracked, wide-field nightscapes.
  • ASTAP (free, all platforms) — stacking plus the plate-solving engine from our plate solving guide.
  • PixInsight (paid) — the deep-sky standard; its WeightedBatchPreprocessing script runs the entire chain. It is what I use for all my own data.
  • Astro Pixel Processor (paid) — friendlier than PixInsight, strong on gradients.
Stacking astrophotography images in the free Siril software
Siril, a free cross-platform stacker, after calibrating and integrating a deep-sky image set. Credit: Lock42, Wikimedia Commons, CC BY-SA 4.0.

Common beginner mistakes

  • Shooting flats after changing the optical train. Rotate or remove the camera first and the dust map no longer matches — the doughnuts stay, or turn into bright spots.
  • Darks at the wrong temperature. Warm-evening darks under cold-night lights leave hot pixels behind, or overcorrect them into black holes.
  • Stacking JPEGs. JPEG compression already destroyed the faint signal. Shoot RAW or FITS, always.
  • Too few calibration frames. A master flat built from three frames stamps its own noise into every image.
  • Expecting preprocessing to rescue bad capture. It removes noise and defects — it cannot sharpen soft stars or fix trailing. Those are solved at the telescope with good focusing and guiding.

Frequently asked questions

Is preprocessing the same as post-processing?

No. Preprocessing is the mechanical cleanup stage — calibrating with dark, flat, and bias frames, then stacking — and it has one correct outcome. Post-processing is the creative stage that follows: stretching, colour balancing, and sharpening the stacked image to taste.

How many dark frames should I take?

Twenty to thirty is the sweet spot for most setups. Fewer than ten leaves visible noise in the master dark, while more than thirty brings rapidly diminishing returns because master quality improves only with the square root of the frame count.

Do I need bias frames with a CMOS camera?

Usually not. Most cooled CMOS cameras calibrate more reliably with dark flats — dark frames matched to your flat exposure — because their sensors can behave inconsistently at the ultra-short exposures bias frames use. Bias frames remain standard for DSLRs and CCD cameras.

Can I reuse dark frames from another night?

Yes, if the sensor temperature matches. Cooled astronomy cameras regulate their temperature, so a master dark library stays valid for months. With a DSLR, only reuse darks shot at a similar ambient temperature, exposure time, and ISO — otherwise shoot fresh ones after your session.

Can I stack images without calibration frames?

Yes — the software will align and average your lights regardless, and for a first attempt that is fine. But hot pixels, vignetting, and dust shadows will remain and get amplified when you stretch. Flats make the single biggest visible difference, so add them first.

Does stacking replace long exposures?

Not entirely. Stacking improves signal-to-noise with every frame you add, but each individual exposure still needs to be long enough for real sky signal to overcome the camera's read noise. Many short frames work well on bright targets; faint targets still favour longer subs.

Next steps

You now know the secret behind every deep-sky image: photograph your camera's errors, subtract them, and stack what remains. Shoot a set of darks and flats on your very next session — it costs minutes and transforms the result. For the capture-side skills, see our guides to polar alignment and autoguiding, plan your exposures with the astrophotography calculator, and see where preprocessing fits in the full beginner roadmap in our essential astrophotography fundamentals guide.

Written by Hamza Touhami, an astrophotographer since 2008 who operates a remote imaging rig under the dark skies of Deepsky Chile.

Featured image: the Andromeda Galaxy (M31) captured without a telescope and stacked in DeepSkyStacker, by Milkomède, Wikimedia Commons, CC BY-SA 4.0.

Written by

Hamza
Astrophotographer since 2008, imaging the deep sky from a remote rig at Deepsky Chile — a 12.5-inch Alluna RC on a Paramount MX+. Founder of Stellar Nomads. Instagram @stellar.nomads.

On this page

What's Next?