
Your stack is finished and the picture looks black: stretching explained
Four hundred frames integrated, half the battery gone, fingers past feeling. You save the stack, open the file, and what comes up is a near-black rectangle with a dozen dots in it. The first instinct is to blame the night. The file is actually full: the galaxy is in there, sitting inside a band of values so narrow and so hard against zero that no screen will ever pull it out unaided. One step is missing, the one everybody calls stretching, which really means opening up the histogram. You take that band and spread it across the whole scale. It looks like a finishing touch. It is the stage where most good sessions get thrown away.
The sensor counts, your eye interprets
A photosite does one job: it counts photons and hands back a number. That count is linear, and linearity is a virtue, since a thousand photons are worth exactly twice five hundred at nine in the evening and again at three in the morning. Your perception behaves nothing like that. The CIE defines perceived lightness L* as a modified cube root of luminance, L* = 116·(Y/Yn)^(1/3) − 16 above a small threshold, with a short linear run near black. You already know the practical upshot without the formula: a surface returning eighteen per cent of another one’s light looks about half as bright.
Everything downstream follows from that mismatch. Any image headed for a screen gets encoded with a curve that compensates for it, and the sRGB standard (IEC 61966-2-1) does it with a linear segment near zero followed by a power law with a 2.4 exponent, the whole thing approximating the gamma 2.2 people have been talking about for thirty years. Daylight shots leaving your phone have already had that treatment, plus a handful of tone curves the manufacturer chose before you ever laid eyes on the file. Your stack is still linear. Honest, complete, and effectively unreadable.
Nobody is inventing photons here
One suspicion is worth clearing up straight away: stretching adds nothing to the image. It is a reassignment of tones, a lookup table declaring that the value 400 shall henceforth be called «thirty per cent», and that is the entire trick. Signal you failed to collect in the field stays outside the file, tonight and forever. Signal you did collect, squeezed into two hundredths of the scale, opens out across the full height of the display.
In a sixteen-bit stack from a decent night the sky background usually lands somewhere between zero and two per cent of scale, with the faint nebulosity just above it. Asking a display to show those differences as they stand is asking it to distinguish black from black. Stretching moves the problem into the region where your eye works well, and in that region the eye is a surprisingly fine instrument.
The histogram is the only serious tool
Close the preview and open the histogram. What you get is a very narrow spike welded to the left edge, and that spike is the sky background: millions of pixels holding the same near-nothing. Running off to the right, barely off the floor, is the tail of the stars. The part you actually came for, the spiral arms or the thread of nebulosity, leans against the right flank of the spike and is nearly invisible in the plot.
From there you work with three controls, whatever your app calls them: black point, midtone, white point. The midtone does the heavy lifting, bending the curve upward and lifting the shadows while the ends stay put. The white point is needed rarely and should be moved stingily. The black point is the one that ruins pictures.
The rule that saves faint nebulosity
Never let the black point cut into the spike. Dragging it right until the background goes solid black is instantly gratifying, the sky looks clean and the contrast arrives all at once, and it also deletes the weakest part of your signal, which was living exactly there, propped against the left flank of the distribution. Once that region is zeroed it does not come back. No curve applied afterwards can recover values that are now uniformly zero.
Standard practice among deep-sky processors is to keep the sky background clear of the floor, roughly a tenth of the way up the histogram. A dark grey sky will look wrong to you for a good ten minutes. Then you notice it is the only one with anything left in it to bring out, and you start spotting that the astro images you admire nearly all have a background you can measure with an eyedropper.
Five small pushes beat one hard pull
The temptation is to drag the slider where it needs to go in a single move. You can spot the result across a room: fat white star cores, halos around the bright ones, grain coarsened into blotches that the brain happily mistakes for detail. Work in stages instead. A gentle curve, a look at the stars, another gentle curve.
Between passes, watch two things. The histogram peak, which should creep rightward a little at a time, and the cores of the brightest stars: the moment they saturate, their colour is gone. Five timid passes get further than one aggressive one, because each time you correct course against the result in front of you rather than the intention you started with.
The gradient that shows up halfway through
Somewhere on the way up, the same thing happens to nearly everyone: one corner of the frame turns orange. It did not appear just now, it was there from the start. That is light pollution from the nearest town, a very gentle ramp worth a few levels in the linear file, which your curve has just multiplied along with everything else.
Order of operations decides how this ends. Gradients come out first, while the image is still linear and their shape is still a tilted plane that models cleanly. After a stretch that same ramp has become a curved surface, and any removal tool will do a worse job of it, leaving pale halos where the gradient used to blend. Anyone shooting from a city balcony learns the sequence the hard way, normally after sacrificing two or three promising stacks to it.
Eight bits run out of room
If the file you are about to stretch is a JPEG, stop for a second. Eight bits per channel gives you 256 levels in total, and the sky background with its nebulosity on top occupies perhaps twenty of them. Spreading twenty levels across two hundred and fifty-six means manufacturing two hundred and thirty-six values that were never in the file: the software interpolates them, and what lands on screen is banding, those concentric steps that stand out horribly in a graded sky. At sixteen bits the same twenty starting levels become five thousand, and there is room to work. The RAW versus JPEG decision is made before you press the button, and nothing downstream reverses it.
Colour is data, defend it
There is a side effect that catches people out: after a decisive stretch the image loses saturation. The curve compresses the top of the scale, the three channels converge, and the stars drift towards white. Stellar colour is a physical measurement, photosphere temperature read through three filters, and dumping it out of impatience is waste. Saturation goes up after the stretch, with the stars as your reference. A field where the blue-white of Vega and the orange of Aldebaran are still telling themselves apart is a field that was stretched with judgement.
Knowing when to stop
There is a criterion, and it is visual. Zoom the sky background to a hundred per cent and look at it for a few seconds. As long as the grain stays grain, fine and even, you have room to push. Once it starts clumping into soft patches tens of pixels across, you have passed the point where you were stretching signal and started stretching noise. Every pass after that makes the picture worse while appearing to make it better, which is the most efficient method yet devised for wrecking a good night out.
The astronomy editor in AstroStackerPro follows the same logic: noise reduction, sharpening, saturation and light pollution removal applied to a stack that has just been integrated, with all the data still in the building. Live stacking collects the photons; stretching decides what to do with them. The first job the machine handles while you stand shivering next to a tripod. The second one, for now, is yours.
Transparency: This article was written by the automated newsroom of 3SIGNUM (claude-opus-5). It's in the manifesto, not a secret.