🎨 Removing the Sky Background Gradient

Linear Processing · lesson 7 of 12 · 3 min

Your stacked image is clean, but the background is not uniform: one brighter corner, an orange tint rising from one edge, a greenish veil. This is a gradient, and removing it is the first operation of linear processing.

Where do gradients come from?

  • Light pollution: the sky is brighter toward a city and near the horizon. With sodium or LED street lighting, the veil takes on an orange or grayish tint.
  • The Moon, even outside the field, lights one part of the sky more than the other.
  • The target's altitude changes during the night: the gradient rotates and overlaps differently from one frame to the next.
  • Poorly corrected vignetting produces a circular pattern (dark or bright edges). That one does not respond well to gradient removal: revisit your flats.

How gradient removal works

Siril's gradient removal tool places samples across the image, in areas assumed to be sky background. From these measurements, it models a smooth surface representing the gradient, then subtracts it from the image (or divides by it, to correct a vignetting-type defect).

Two settings matter:

  • The degree of the model: a simple model (degree 1 or 2) follows a regular gradient, like that of light pollution. A higher degree follows more complex variations, but risks also fitting real structures.
  • Sample placement: this is the tricky part. A sample placed on a faint nebula, a galaxy arm, or a bright star makes the software believe that this signal is background, and it erases it.

Placing samples well

Start with automatic generation, then check using a strongly stretched display:

  1. Remove the samples placed on the object, on its faint extensions, and on bright stars.
  2. Keep samples in the corners and along the edges: that is where the gradient is strongest.
  3. On a field filled with nebulosity (Milky Way region, large nebula), be very sparing, and prefer a simple model.

After removal, look at the subtracted image and, if your software allows it, at the background model itself. The model should be a smooth surface, with no trace of the object. If you recognize the shape of your nebula in it, some samples were badly placed.

Sometimes a single pass is not enough. A second extraction, with a simple model, can remove a residue. Avoid chaining more: each pass risks eating away at the faint signal.

Other tools

GraXpert, free, is a specialized tool that models the background (including with an artificial intelligence method) and can be used before returning to Siril. PixInsight offers several equivalent tools. The principle is the same everywhere: distinguish what is unwanted skyglow from what is your object.

The best gradient treatment is still preventive: photograph the target as high in the sky as possible, away from the Moon and on the side opposite the city. The light pollution map will help you choose your site.

Key points

  • Gradients come from light pollution, the Moon, or the changing altitude of the target.
  • Gradient removal models a smooth surface from background samples, then subtracts it.
  • A sample placed on the object erases real signal: check them on a stretched display.
  • A circular pattern is more likely a flats problem than a gradient.
  • Shooting high, away from the Moon and cities, limits the gradient at the source.

🧮 Exercise

On your stacked image, run gradient removal with automatic samples, then run it again after removing those that touch the object. Compare the two results on a strongly stretched display.