How to stack astrophotography images for free
Stack night sky frames with bias, dark and flat masters, star alignment and sigma clipping in Paint by Zaweba, which also opens FITS files.

To stack astrophotography images on Windows without paying for anything, use Paint by Zaweba and choose File > Automate > Astrophotography Stacking. It takes your light frames, applies bias, dark and flat masters, lines the frames up on their stars and combines them with sigma clipping, so satellite trails and stray hot pixels drop out of the result. FITS files from astronomy cameras open too, as 16-bit documents.
Stacking works because the noise in each frame is random while the stars and nebula are not. Average enough frames and the faint detail climbs out of the grain. The rest of this article walks through getting your files ready, running the stack and finishing the picture in the same editor.
What to shoot before you stack
The command is built around the usual set of frames that astrophotographers collect. Light frames are the real exposures of the sky. Bias frames are the shortest exposures your camera can make with the lens capped, and they record the camera's fixed electronic offset. Dark frames are taken with the cap on at the same exposure length and similar temperature as your lights, so they capture the warm pixels and thermal noise. Flat frames are shots of an evenly lit surface through the same optics, and they record dust shadows and the darkening towards the corners.
You don't need hundreds of each. A handful of bias, dark and flat frames is enough to build a master of each kind, and the more light frames you have, the smoother the final stack. Keep the camera settings the same for every light frame, and don't move the focus between lights and flats.
Running the stack in Paint by Zaweba
Open File > Automate > Astrophotography Stacking. Point it at your light frames, then at the bias, dark and flat frames so it can build the masters. Paint subtracts the bias and dark signal, divides out the flat, and then aligns every light frame on its stars before combining them. Sigma clipping looks at each pixel across the stack and throws away values that sit far from the rest, which is exactly what a plane, a satellite or a cosmic ray hit looks like.
If your camera writes FITS files, open them directly. They come in as 16-bit documents, which keeps the very faint tones that an 8-bit file would crush together. Camera RAW files also open as 16-bit through the RAW Developer, so a stack shot on a normal camera keeps its depth as well.
The same File > Automate menu has a general Image Stacking command too, with modes such as mean, median, maximum and minimum. Maximum is the one people use for star trails, where you want every frame's stars to stay. Median is handy for removing people from a busy scene. For deep sky work, though, use the astrophotography version, because the calibration masters and star alignment are what make the difference.
Bringing out the faint detail
A fresh stack usually looks dark and flat. That's normal: the signal is there, squeezed into the bottom of the histogram. Work on it with adjustment layers rather than painting on the pixels, so you can go back and change a stretch without starting again. Curves and Levels are the usual tools for lifting the faint parts while holding the bright star cores. Because the stack is 16-bit, you can stretch hard before banding shows.
Light pollution often leaves a colour cast or a gradient across the frame. Take it down gently with colour adjustments, and keep an eye on the background sky so it ends up a neutral dark grey rather than pure black. Crushing it to black throws away the faintest outer parts of a galaxy or nebula.
Mistakes that spoil a stack
The most common problem is calibration frames that don't match. Darks taken at a different exposure or on a much warmer night will leave speckles or dark holes. Flats taken after you've moved the focus or turned the camera will add rings instead of removing them. Shoot flats at the end of the session with nothing touched.
Another is saving too early in an 8-bit format. Keep the working file as a .ptx, which is Paint's own format where every layer and adjustment stays editable, and only export a JPEG or PNG once the picture is finished. Exports to 8-bit formats are dithered, which helps, but the editing room lives in the 16-bit master.
Paint by Zaweba is free software, works fully offline and needs no account, so a night's frames can be stacked on a laptop in a field with no signal at all.