Passer au contenu

Langue

Pays

Dark Frames in Astrophotography: The Complete Guide

Dark Frames

New imager, first few nights, and you notice your images are speckled with tiny colored dots you didn't put there. First reaction: something's wrong with the sensor. Maybe it's used? Maybe it's defective? Well... it's neither. Every sensor has hot pixels, sites that leak more than their neighbors, and it's completely normal. You just haven't taken darks yet.

A dark frame is a photo of your sensor's predictable signal in the dark. Same exposure, same gain/ISO, same temperature as the lights. However, no photons should hit the sensor. Subtract that image from your light frame and the hot pixels go away, along with two things that might be riding along with them: amp glow (not present on every camera) and the general thermal signal your sensor generates just from being turned on. Get the settings wrong, gain mismatch, wrong temperature, and the subtraction doesn't help you. It hurts you.

The Noise Budget: Read, Shot, and Dark Noise

Here's something worth understanding before you get lost in settings: your final noise doesn't come from one source, it's three.

  • Read noise (N_Read) — from your sensor's electronics
  • Shot noise (N_Shot) — from your sky background and the target itself
  • Dark noise (N_Dark) — the random part of dark current, not the predictable offset a dark frame subtracts

These don't just add up. They add in quadrature:

N_total = √(N_read² + N_shot² + N_dark²)

Whichever term under that square root is biggest dominates the result. If your sky background shot noise is already three times bigger than your dark noise, you can chase dark noise perfection all night and barely move the needle.

A dark frame only removes part of dark current's effect. It subtracts the thermal signal, the repeatable offset baked into every exposure at a given temperature and duration. It can't touch N_dark itself though, the random shot noise sitting on top of that thermal signal. Stacking more darks makes your master dark more precise. It does nothing to the N_dark noise already sitting in your light frame. No number of darks gets you to zero.

How to Capture Dark Frames

Even though two dark frames shot at different settings might look identical to your eye, they're not equivalent. The one that doesn't match your lights won't calibrate properly.

Five things to match, exactly, between your darks and your lights.

NoteThese darks calibrate your lights specifically. Flats can use their own thermal calibration too, dark-flats, a related but different frame type.
Setting Value Why?
Gain (or ISO) Same as your lights Sets your electron-to-ADU conversion. Mismatch and you're subtracting numbers measured on two different scales.
Binning Same as your lights Changes your effective pixel size and read noise per pixel. A dark shot at a different binning doesn't map to the same physical pixels.
Offset (black level) Histogram shows clean separation from zero, no pileup Too low and your darkest pixels clip. Once clipped, that data is gone, not recoverable by calibration.
Temperature Same as your lights Dark current often approximately doubles every 5–6°C on CMOS, 5–9°C on CCD. A 10°C mismatch isn't a rounding error, it's a multiple.
Duration Same as your lights, or scaled properly Dark current scales linearly with exposure time.
Blocking stray light No light leaks during acquisition Any leak becomes false signal baked into every light frame you calibrate.

Gain (or ISO)

Gain (or ISO, on cameras that use it instead) needs to match exactly between your darks and your lights. It sets your electron-to-ADU conversion, how many photoelectrons correspond to one ADU, the digital brightness value recorded in your file. Mismatch it and you're subtracting numbers measured on two different scales.

One more reason to care about this on the IMX571 (ASI2600) and IMX455 (ASI6200). These sensors switch to a different readout mode, high conversion gain, at gain 100 on ZWO cameras. Shoot your lights at gain 100 and your darks at gain 0, and you're not on the same hardware mode anymore. The read circuit itself behaves differently, so match your gain.

Binning

Binning needs to match too, but for a different reason. Binning combines multiple physical pixels into one, which changes your effective pixel size and the noise characteristics per pixel. A dark frame shot at a different binning than your lights isn't measuring the same physical pixels, the subtraction won't line up correctly no matter how close the exposure, gain, or temperature are.

Offset (black level)

Offset is the one setting that's easy to get subtly wrong. It's the floor that keeps your sensor's darkest readings from trying to record a negative value and clipping to zero instead. Set it too low and your faintest background pixels get clipped before you even see them. Once a pixel is clipped, that data is gone, there's no negative value hiding underneath to recover. Subtracting a master dark from a light frame with clipped pixels doesn't fix them, it flattens the background around them into smeared, artificially smooth patches.

Clipping isn't only an acquisition-time problem either. It can happen at the subtraction step itself. If your master dark's background level ends up higher than your light frame's actual floor, an offset mismatch between the two, subtracting one from the other can push pixels below zero. Those pixels clip to black on the spot, showing up as small dark holes in your background rather than the smeared patches you get from acquisition-time clipping.

Check it with a histogram: shoot a bias or dark at your working gain, and confirm the distribution has clear separation from the left edge, no pileup of pixels sitting at zero. A gap of a few hundred ADU is normal and safe. Change your gain, and you need to recheck offset and reshoot your calibration frames, the two settings are coupled.

Temperature

Dark current often approximately doubles every 5–6°C on most CMOS sensors, every 5–9°C on a CCD. For example, take the ASI2600MC Pro:

  • At 0°C: about 0.0022 e⁻/s/pixel (ZWO's published spec)
  • At -10°C: about 0.0005 e⁻/s/pixel, a quarter of the 0°C value, two doubling intervals down

[Dark current vs. temperature curve for the ASI2600 — source: ZWO ASI2600 manual]

Shoot your lights at -10°C but your darks at 0°C, two doubling intervals apart, and your darks are subtracting roughly 4 times more dark current than your lights actually have. That overcorrects the subtraction, leaving negative-value artifacts and a patchy background once you stretch the image.

If your camera is cooled, match your dark temperature to your light temperature. If your camera is not cooled, shoot darks the same session as your lights, but keep them in your library rather than throwing them away. If you get a night at the same ambient temperature again, you can reuse them instead of reshooting.

Pick a setpoint your cooler can actually hold all season, so you're not reshooting your library every time the weather shifts. My camera cools about 35°C below ambient. In summer, that means I set 0°C as my target, since that's what I can hold reliably even on the warmest nights. If ambient temperature spikes and your cooler is already running at 100% power without hitting your setpoint, you're not at your target temperature anymore. Your lights drift off whatever temperature your darks were shot at, and you won't necessarily notice until you're looking at a patchy stretch back home.

Duration

Dark current scales linearly with exposure time. Double the exposure, double the accumulated thermal signal. That's why your dark frame duration needs to match your light frame duration, for the same reason gain needs to match. If it doesn't, you need to scale your master dark's signal to your light frame's exposure time rather than subtracting it directly, a technique covered in its own section further down.

Blocking stray light

Not every shutter or cap seals fully. Cap your camera and, if possible, shoot your darks in a dark room. Feel free to do it during a cloudy night, so you're not losing precious imaging time. Any light leak during a dark exposure becomes false signal, and that false signal gets baked into your master dark and subtracted from every light frame you calibrate with it. The goal is zero parasitic light, make sure nothing can reach the sensor.

Hot Pixels and Amp Glow: What Darks Actually Remove

Dark current isn't the whole story. Two specific artifacts are the reason dark frame calibration matters in our images.

Hot pixels are individual sites on your sensor with abnormally high dark current, sometimes orders of magnitude above their neighbors. They show up as small bright dots, colored on a one-shot-color camera depending on which Bayer channel they land on. They're not fixed either, hot pixel maps shift, new ones appear, existing ones intensify as a sensor ages. I'll cover how often to refresh your dark library for this further down.

Amp glow is a spatial pattern, usually a soft gradient or corner brightening, caused by heat generated near the sensor's readout electronics or amplifier during exposure. It's sensor-specific, some cameras show none, others show a pronounced glow that gets worse with longer exposures. A proper dark frame captures both the hot pixel pattern and the amp glow gradient, and subtracts both at once.

CMOS vs CCD: Why the Old Rules Don't Apply

Most calibration advice online treats CMOS and CCD the same way. They're not, and the difference changes what you actually need to do.

Modern CMOS cameras typically run under 2 electrons of read noise, with dark current low enough at normal operating temperatures that it barely shows up in the noise budget. CCDs run higher read noise, usually 6 to 16 electrons, with dark current that's manageable with moderate cooling but not negligible the way it often is on CMOS.

That difference is exactly why dark scaling doesn't hold up on CMOS the way it does on CCD. CCD workflows have long used a shortcut: measure dark current from a bias exposure, then mathematically scale a master dark to any exposure length, without shooting a full set of darks at every duration. Works fine on CCD, because on older CCDs, bias level was relatively high and read noise dominated the noise budget, so the linear math behind scaling held up well in practice.

Modern CMOS sensors break that assumption in more than one way. Low-signal non-linearity is one contributing factor, at very low signal levels, some sensors deviate from a purely linear response. Another is that many CMOS sensors apply their own on-chip digital processing, hardware pedestal adjustments among them, before the raw data even reaches your capture software. Scaling assumes a clean, predictable linear relationship between exposure time and signal, and either factor can undermine that. It's unreliable even on sensors with no visible amp glow, testing on the QHY268M specifically suggested scaled darks may not hold up as well as matched-exposure darks. Whether that holds broadly across modern back-illuminated CMOS sensors is still an open question. I'm working on a proper test methodology to check it directly rather than assume the old CCD-era rules still apply. More on that as it develops.

The back-illuminated Sony sensors in cameras like the ASI2600 (IMX571) and ASI6200 (IMX455) include on-chip circuitry specifically designed to suppress amp glow at the hardware level. At that level, dark current itself is barely a factor. What a dark frame is doing on one of these sensors is almost entirely mapping hot pixels, not correcting meaningful thermal signal. That doesn't mean scaling is risk-free, though. Even a sensor this clean doesn't behave linearly enough to guarantee a scaled dark matches a real one exactly. It's not going to wreck your image, but matched darks are the more precise choice, and they cost you nothing but a bit of storage.

Some imagers on these zero-amp-glow cameras skip full dark libraries entirely and rely on a bad pixel map instead, covered further down, especially if they dither consistently. If you're on an older CMOS sensor without this hardware, or on CCD, that shortcut doesn't apply to you. Check your camera's dark current in its specification table before assuming it does.

How Many Dark Frames Should I Take

Noise in your master dark drops by 1/√N as you stack N frames.

Frames Noise vs. single frame Best for
16 25% Minimum useful reduction
25 20% Uncooled or DSLR, reshooting each session, time-constrained
50 ~14% Cooled camera, building a reusable library
100 10% Cooled camera, faint work, advanced

If you're uncooled or shooting DSLR and reshooting darks every session, 25 is a reasonable stopping point, the time cost isn't worth chasing marginal gains. If you're on a cooled camera building a library you'll reuse for months, 50 is worth the one-time investment, since diminishing returns matter less when you're not repeating the effort. Past that, 100 makes sense for cooled setups chasing very faint signal, the kind of target where every bit of noise reduction earns its place.

None of these numbers are a fixed rule. The real target is your master dark's noise relative to the other noise sources already in your light frames, once it's well below those, more darks stop helping. And no stack of darks removes N_dark from your light frame itself, this table tells you how precisely you've measured the signal, not how much noise you've erased.

Building the Master Dark: Integration & Rejection

Stacking your individual dark frames into a master isn't just one step, it's two decisions: how you combine them, and whether you reject outliers first.

Combination method

Average integration gives you the best signal-to-noise, and it's the right choice once you have more than 20 frames. But if a cosmic ray hits one of your dark exposures, and that's not rare over a multi-minute exposure, a plain average bakes that hit into your master. Diluted, but it's there. Subtract that master from every light frame afterward and that corrupted pixel rides along with it.

Median integration picks the middle value at each pixel instead, so one outlier gets ignored rather than blended in. Use it if you're stacking fewer than 20 frames, though I don't recommend going that low in the first place. Trade-off: slightly noisier than average, since median throws information away instead of using all of it.

Rejection algorithm

Use average combination with pixel rejection. There are several rejection algorithms out there, but for darks, Winsorized sigma clipping gives the best results. It computes the mean and standard deviation at each pixel, discards anything outside your threshold (kappa, typically 2 to 5), then replaces those rejected values with a clipped estimate rather than dropping them outright. You get average's noise performance while still catching the outliers a plain average would bake in.

Cosmic rays are the main thing you're guarding against here, and they only push in one direction, a hit adds signal, it never removes it. That's why it's worth setting your high and low thresholds differently rather than using one symmetric value, something like 3σ on the high side and 4σ on the low side is a common starting point. You're rejecting harder against the outliers that actually show up in darks.

Normalization

None. Don't normalize your dark frames before combining. Normalization adjusts each frame's brightness to match the others, which is useful for light frames with varying sky conditions, but darks should already be consistent frame to frame at fixed settings. Normalizing them would distort the actual thermal signal you're trying to measure.

Dark Frame Scaling: When It Works, and When It Breaks

Scaling lets you calibrate a light frame without a matching dark exposure time in your library. Useful if you shoot variable sub-lengths, or don't want to maintain darks for every possible duration.

The standard method: subtract a bias frame from a longer reference dark to isolate the pure dark current signal, scale that signal linearly to your light frame's exposure time, then add the bias back. Works well on CCD, where dark current scales close to linearly with time.

It does not reliably extend to CMOS, dedicated astro cameras or DSLR alike, since both use the same sensor technology and both can exhibit amp glow that doesn't scale the same way. Amp glow doesn't scale linearly with exposure the way pure dark current does, so scaling a short reference dark up to a long exposure can under- or over-correct the glow specifically, even while getting the general dark current level roughly right. The visible result: remnant glow, a faint ghost of the pattern still there after calibration, or in the worse case, inverted glow, an actual dark patch where the glow used to be.

And it's not just cameras with visible amp glow. Testing on the QHY268M, a sensor with hardware amp glow suppression, suggested scaled darks may not hold up as well as matched-exposure darks. Whether scaling still earns its keep on modern back-illuminated CMOS sensors, versus the CCDs and early CMOS cameras this wisdom was built around, is genuinely still an open question. Thermal noise characteristics and the read noise floor are different enough on today's sensors that the old assumptions deserve a real check, not just inherited habit. I'm putting together a proper test methodology for this, comparing scaled against matched darks on modern CMOS data. It may take a few iterations to get the methodology solid. I'd rather do that right than rush to a conclusion. Full writeup once it's ready.

If you're on CMOS and see either artifact, or you're not sure your sensor scales cleanly, disable scaling or dark optimization in your calibration software and shoot matched darks instead. On CCD, if your calibrated frames look clean, scaling remains a reasonable way to avoid maintaining a large dark library.

Building a Dark Frame Library That Actually Lasts

Rather than shooting darks fresh every session, most imagers build a reusable library organized by gain, temperature, and exposure duration. Pull the matching master when you need it instead of shooting new darks that night.

Two things break a library over time. Hot pixel patterns shift as your sensor ages, so a library shot a year ago may not fully match your current sensor state. And if you're uncooled, or your cooling setup changes, ambient conditions on a hot summer night versus a cold winter one can push you outside the range your library covers.

Rebuild every 6 months. I do mine twice a year, once before winter hits, since I'm cooling down to -25°C at that point, and again in the warmer months when I'm not pushing the cooling as hard.

Dithering: The Habit That Catches What Calibration Misses

Dark calibration doesn't solve everything. I established this in the noise budget section, no amount of darks removes N_dark, the random noise sitting in your light frame itself. But calibration is never perfect either, a slightly imperfect subtraction leaves a faint residual pattern behind. That residual isn't N_dark, and it isn't random, it's fixed to specific pixels, the same hot pixel or the same edge of an amp glow gradient, frame after frame. If you stack enough frames without moving, instead of averaging that pattern away, you reinforce it, since it's sitting in the exact same spot every time.

Dithering, small pointing shifts made during capture between light frames, breaks that. Each frame gets aligned to the stars during stacking, which means that fixed residual lands on a different pixel every time. Rejection stacking, the same Winsorized sigma clipping you're using on your master dark, then catches it as an outlier and throws it out rather than letting it accumulate. Skip it, and that residual stays put. It shows up as streaks running through your stack, walking noise. Always dither. It's the one habit that catches what your calibration misses.

Bad Pixel Maps: The Alternative to a Full Dark Library

A bad pixel map, or BPM, is a saved list of your sensor's known hot, cold, and dead pixel coordinates. Built once from a batch of darks, reused going forward. Instead of subtracting a thermal signal, calibration software interpolates each flagged pixel from its neighbors.

What a bad pixel map actually fixes

A BPM fixes dead, hot, and stuck pixels. Nothing else. It does nothing for pattern noise, amp glow, or sensor offset. Calibration with dark frames handles all of that.

Here's the one that catches people out, even on a sensor with almost no dark current: offset. A dark frame subtracts your sensor's baseline offset along with the thermal signal. A BPM patches pixels, not the image-wide baseline. Without that subtractive offset calibration, a master dark, or bias and dark-flats, flat correction still runs, it just becomes biased. The pedestal, that baseline offset, is still sitting in your data, so the division isn't properly normalized. Vignetting and dust won't calibrate out cleanly. So even on a sensor where thermal signal is basically negligible, you still need something handling offset, or your flat correction won't be accurate.

Bad pixel map vs dark frame

BPM Dark frame
Added noise None Adds the dark frame's own read noise
Temperature matching Not required Required
Exposure/gain matching Not required Required
Sensor offset Not handled Handled
Pattern noise, amp glow Not handled Handled
Storage Coordinate list Full library

No added noise. Subtracting a dark frame adds that frame's own read noise into your image. A BPM touches nothing but the flagged pixels.

No temperature matching. A hot pixel's location doesn't move with temperature, just how visible it is. Build a BPM once at room temperature, it keeps working across your whole shooting range.

No exposure or gain matching. One BPM covers every setting you shoot at.

Barely any storage. A coordinate list versus a full library of master darks.

Does a bad pixel map work on modern CMOS cameras?

A bad pixel map alone doesn't work well on CCD or an older CMOS sensor with significant dark current and visible amp glow, the gap is real, it leaves genuine thermal signal untouched. On a sensor like the ASI2600, dark current is already close to negligible, so for hot pixels specifically, a BPM and a proper dark library land close to the same result.

How to build a bad pixel map

To build a BPM, you still need to start with darks, just not the way you'd usually do it. Shoot 10 to 15 long exposures at room temperature, that's fine, a hot pixel's location doesn't depend on temperature. Your software analyzes the batch statistically, flags what stands out, saves the coordinates. Done. Reuse it for months, sometimes over a year, until new hot pixels show up your map isn't catching.

Should you use a bad pixel map or dark frames?

This isn't really an either-or choice, not on a modern zero-amp-glow sensor. The real workflow combines both:

  • Something for offset, a master dark or bias/dark-flats, so your flats calibrate right
  • A BPM for cosmetic hot and cold pixel correction
  • Dithering with rejection stacking doing most of the real work against walking noise

Full dark subtraction alone, or a BPM alone, both leave something on the table. Together, with dithering doing its job too, they cover what each one misses.

Common Dark Frame Calibration Problems

Residual amp glow after calibration

Almost always a scaling problem on CMOS. Switch to matched darks.

A grid or blotchy pattern after stretching

Usually a temperature mismatch, an uncooled camera, or a library shot on a different night at a different ambient temperature.

Colored dots that won't fully disappear

Aging hot pixels your library hasn't caught yet. Rebuild.

Background darker or lighter than expected after subtraction

Check gain and offset match exactly between darks and lights. A gain mismatch throws off the whole subtraction, not just the fine pattern.

Flattened, blotchy shadow detail

Offset was set too low, pixels clipped during acquisition. No fix after the fact, the data's gone. Raise offset, reshoot.

Small dark holes in the background

Your master dark's background level is higher than your light frame's actual floor, an offset mismatch between the two. Subtraction pushes those pixels below zero, and they clip to black on the spot.

Streaking or a mismatched pattern despite matched settings

On Sony sensors like the IMX571 or IMX455, check whether your darks and lights crossed the gain-100 threshold on a ZWO camera. One side in high conversion gain, the other in low, and you're not on the same hardware mode anymore.

Article précédent Préparer l'accélération CUDA pour PixInsight
Articles suivant Ciel du mois: Juillet 2026

Laisser un commentaire

Les commentaires doivent être approuvés avant d'apparaître

* Champs obligatoires