Background Neutralization

Equalize the per-channel background so the sky is neutral grey, using the medians inside a sample box. Shadows are lifted onto a common background level while bright highlights (stars, bright nebulosity) are left untouched — so colour balance in the signal survives.

1. Using the tool

Pick a patch of empty sky — manually or automatically — and click Apply Neutralization. SASpro computes the per-channel medians inside the box, picks the mean as the common target, and rebalances the channels so the background reaches it.

Choosing the sample box

Preview & apply

2. Technical details

RGB only. The sample box fixes a per-channel baseline; the rebalance pins highlights at 1.0 so bright signal doesn't drift.

2.1 The neutralization

Optionally, a per-channel pedestal is removed from the whole image first — each channel's minimum is subtracted so the darkest pixel per channel sits at zero:

I_c\;\to\;I_c-\min(I_c)\quad(\mathrm{per\ channel,\ whole\ image})

Then the per-channel medians inside the sample box, and the common grey target as their mean, are computed:

m_c=\mathrm{median}\!\left(I_{\mathrm{sample}}[\cdot,c]\right)\,,\qquad t=\frac{1}{3}\!\left(m_R+m_G+m_B\right)

The default rebalance is a per-channel gain pivoted around 1.0, which keeps bright pixels fixed and only lifts the shadows:

g_c=\frac{1-t}{1-m_c}\,,\qquad \mathrm{out}_c=1-(1-I_c)\,g_c

By construction this maps I_c = m_c → t (every channel's background lands on the shared grey) and I_c = 1 → 1 (pure white is left alone), so star cores and highlights don't drift colour:

\mathrm{at}\ I_c=1:\ \mathrm{out}_c=1\,;\qquad \mathrm{at}\ I_c=m_c:\ \mathrm{out}_c=t

An alternative offset mode adds a flat per-channel shift sized to not clip:

\mathrm{out}_c=I_c+(t-m_c)\quad(\mathrm{capped\ to\ avoid\ clipping})

Offset is simplest and leaves relative colours untouched, but can't protect highlights the way the pivot-at-1 gain does — which is why the pivot form is the default.

2.2 The automatic background finder

With no box drawn, Find Background locates a dark patch of sky in three stages:

The result is a 50×50 background patch; the preview marks its centre with a crosshair rather than a filled rectangle, so you can see exactly which point drives the medians.

2.3 Masking

With an active mask on the destination document, the neutralized image is blended back against the original over the mask, so only masked regions change (out = src·(1−m) + out·m).

2.4 Notes