Fundamentals · PixInsight 1.9.x

GradientCorrection

GradientCorrection (GC) builds a smooth model of the background gradient and subtracts it from the linear image. Structure protection prevents nebula structures from being treated as gradient.

Purpose

TaskSetting
remove light pollution and moon gradientsdefaults, structure protection
remove large-scale colour gradients across the whole imageadditionally Simplified Model
keep structure out of the modelProtection Threshold and Amount

Principle

  • GC judges by smoothness: everything large-scale and smooth counts as gradient. Real large-scale emission (Milky Way, extended nebulae) can therefore partly end up in the model – structure protection or help against this.
  • Whatever is in the model is subtracted from the image. The model must be smooth and must not contain nebula shapes.
  • Gradients differ per filter (light pollution is not spectrally neutral, moonlight is stronger in blue). For mono data correct each master separately, before combining; afterwards the gradients would be merged into colour gradients.
  • Correct before colour calibration: a gradient would distort background estimation and white balance.

Parameters

ParameterEffectTypical choice
Automatic convergenceiterates until the model is stableenabled
Structure protectionprotects detected structures from the modelenabled
Protection Thresholdwhat counts as structure; lower = faint structures too0.05–0.1
Protection Amounthow strongly protected, i.e. how far the model is decoupled from the image there0.5 to start
Generate gradient modeloutputs the model as an imageenabled
Generate protection masksoutputs the protection masks (one per channel for RGB)enabled
Low / High threshold and toleranceexclude unusually dark or bright areas (stars) from the modeldefaults 0.20 / 0.50 / 0.05 / 0.00
Scalesize scale of the modeldefault 5.00
Smoothnesssmoothing of the modeldefault 0.40
Simplified Model / Model degreeadditional polynomial for the large-scale gradientoff; degree 1 if needed
AmountEffectRisk
too lowstructures barely protectednebula signal ends up in the model and is subtracted
about 0.5balanced–
too highgradient under and next to structures barely capturedresidual gradient, blotchy background near the nebula

Operation

  1. Crop first (DynamicCrop): remove stray-light streaks, stacking borders and other artefacts. Otherwise GC tries to model them as gradient and distorts the surrounding background.
  2. Apply to the linear image with threshold 0.05–0.1 and amount 0.5.
  3. Check protection masks, model and result (see below); adjust only if a check reveals a problem.

Typical applications

Extended emission, weak channels

When nebula fills large parts of the image (narrowband, Milky Way fields): keep the Protection Threshold low so that faint outer parts count as structure. Be especially careful with weak channels (OIII, SII) – there the structure lies only just above the background.

Large-scale colour gradient

Wide-field images often show a gradient across the whole frame (e.g. reddish on one side, greenish on the other).

  1. Correct without Simplified Model first.
  2. If an even gradient remains: Simplified Model, model degree 1, correct again and compare.
  3. Higher degrees only for clearly curved gradients.

Adjusting the model

ObservationRemedy
residual gradient visiblelower Scale and Smoothness step by step; the model must not pick up nebula structure
model shows nebula or filament shapesraise Scale or Smoothness; Amount 0.6–0.7
halos around filaments or bright stars in the resultprotection too strong → lower Amount slightly
almost the whole image protected, residual gradient remainsraise the threshold slightly (e.g. 0.1)

Bright star in the field

The halo of a bright star must not be modelled as gradient. Check the model for rings or bright patches around the star.

Alternative: DynamicBackgroundExtraction

DBE with few samples (10–20), only in clearly nebula-free areas and not in the halo of bright stars. Why few: every sample on nebula pulls the model up and subtracts nebula signal.

What a good result looks like

Typical errors

ObservationCauseRemedy
Faint nebula weaker than beforenebula in the modellower the threshold, raise Amount, check the model
Rings or patches around a bright star in the modelhalo captured as gradientadjust protection; with DBE no samples in the halo
Streaks remain in the resultartefacts not removed before correctioncrop, correct again
Colour gradient towards the edges remainslarge-scale part not capturedSimplified Model, degree 1
Blotchy background near the nebulaAmount too highlower Amount

When to use it – and when not

Good forBetter another tool
gradients in broadband and narrowband datadistinguishing real large-scale emission → (broadband, with reference data)
a quick, robust correction without reference datatargeting individual problem areas → DBE with few samples
Used in

HaLRGB workflow · MultiscaleGradientCorrection (MGC) · Narrowband workflow (HOO/SHO) · OSC workflow with a quad band-pass filter · WeightedBatchPreprocessing (WBPP)