Skip to content
Darks, bias and flats on a phone: what is worth calibrating (Image generated with AI)
Image generated with AI

Darks, bias and flats on a phone: what is worth calibrating

Three hundred frames stacked, the Milky Way starting to lift off the background, and scattered among the stars a handful of red and green dots far too crisp to belong to the sky. Go out the following night and there they are again: same coordinates, same colour, same cheek. They come from the sensor. Astrophotographers have been fighting them for decades with calibration frames, that ritual of shooting into a covered lens which every manual prescribes before it lets you go to bed. On a phone the ritual needs trimming, because a good part of the job was done before the file ever reached you.

Three files, three problems that have nothing in common

Anyone coming from a telescope knows the drill. A dark is shot with the lens covered, at the same exposure and the same gain as the good frames, and it records what the sensor produces when no light arrives: dark current, defective pixels, whatever glow the electronics contribute. A bias uses the shortest exposure the camera will allow and measures the starting point, the value pixels report when they have collected essentially nothing. A flat frames an evenly lit surface and photographs the flaws of the optical path: vignetting at the edges, dust shadows, uneven response across the field.

Shooting all three back to back at the end of the night does not make them the same thing. They measure separate phenomena, and on a smartphone the three meet very different fates.

The bias is already baked in, frame by frame

This one closes quickly. Android’s camera documentation explains that in most sensors the active array is ringed by pixel regions shielded under a metal mask: they receive no light by construction and provide, in the documentation’s own words, «a reliable black reference for black level compensation» in the active area. The device reads those pixels and derives its own offset from them. Not once and for all, either: the same documentation describes a dynamic black level, estimated frame by frame and channel by channel, because the value «may vary dramatically» with capture settings, ISO included.

A home-made bias would measure, worse and with far more effort, a quantity your phone measures live using pixels built for the purpose. Skip the series.

The flat is half done, and the other half barely matters

Vignetting is no mystery to the device either. It carries a low-resolution map of correction coefficients for each channel of the Bayer mosaic, the same map it applies to already-processed images. If you go home with a JPEG, that correction is cooked into the picture and the matter ends there. Shoot RAW and it depends on the model: the map may already be applied to the raw file or left aside, and in the second case your corners arrive darker than the centre.

The rest is a question of priorities. A decent flat needs a genuinely uniform light source, and in a night photograph the degradation you actually notice comes not from the optics but from the sky: the gradient eating your low stars is nearly always scattered city light, and it comes out in processing with a background subtraction. Dust, meanwhile, is a rare guest inside the sealed optical block of a phone. If your stack has a glow in one corner, before you build a light box in the living room go and check how dark your site really is.

The dark is the one that earns its place

Defective pixels, on the other hand, are real and they show. Android’s documentation describes them without diplomacy: hot pixel correction interpolates out or otherwise removes pixels «that do not accurately measure the incoming light», meaning those stuck at an arbitrary value or oversensitive. Manufacturers who choose to will even expose the list of coordinates of hot or defective pixels on the sensor. The phone, in other words, already has its list of suspects.

The catch is that this correction has three possible states (off, fast, high quality) and the fast mode does whatever it can manage without slowing capture down. Worse, the factory list covers permanent defects. Pixels that only light up when long exposure, high gain and a warm sensor come together are outside that census, and a night of astrophotography is precisely the combination that wakes them.

Heat is the real opponent, and the one you control least

Dark current grows with sensor temperature and with exposure length, which is why serious astronomical cameras are cooled. A phone does the opposite: it shoots bursts, processes them, keeps the screen alive, warms itself up as it works. The dark you took at nine, with the device fresh out of your pocket, describes a sensor that no longer exists at midnight.

Hence a short operational rule. Shoot darks at the end, with the phone still at working temperature, straight after the last good frame and without leaving the app. Same exposure, same ISO, same noise reduction settings, which on plenty of devices act on RAW as well: if it stays on for the light frames it has to stay on for the darks, otherwise you are comparing two imaginary sensors. You also need a genuinely opaque cover. A dark sleeve draped over the phone lets through more light than you would guess, and a contaminated dark makes things worse rather than better. Fifteen or twenty frames give a clean median, thirty if the battery holds.

Move the framing instead of shooting darks

There is an elegant shortcut, and it grows out of an asymmetry. Defects stay put on the sensor. Stars do not. Once software aligns frames on the stars, every fixed defect ends up shifted by a few pixels from one frame to the next, and an outlier rejection algorithm (sigma clipping, or a properly done median) sees that anomalous value turn up somewhere different each time and throws it out. The technique is called dithering, and in classic practice you get it by deliberately nudging the framing a few pixels between shots.

With a phone on a static tripod, the sky dithers for you: the Earth’s rotation shifts the field from frame to frame, and over a long sequence those fixed dots have nowhere to hide. On a well aligned tracker the situation flips, because the field sits still relative to the sensor and the defects accumulate as faithfully as the signal. That is where darks come back into play, or where you nudge the framing by hand now and then, feigning clumsiness. Live stacking adds up stars and garbage with equal diligence: what changes the outcome is the rule it uses to decide what gets discarded, which is why in AstroStackerPro the frame combination method is not a setting to leave on its default and forget.

The verdict fits on one line: bias never, flats hardly ever, darks only when the field sits still on the sensor. Every minute you do not spend photographing the darkness inside your pocket goes back into collecting real sky, which is the one thing no algorithm can invent on your behalf.

#dark frames#calibration#astrophotography#smartphone#noise#stacking

Transparency: This article was written by the automated newsroom of 3SIGNUM (claude-opus-5). It's in the manifesto, not a secret.

Keep reading