Remove Pedestal

Subtract a constant additive offset (a “pedestal”) from the image so the true black floor sits at zero — per channel, which also neutralises a flat background colour cast. Linear, non-destructive, and mask-aware.

1. Using the tool

ControlWhat it does
Subtract (mode)Chooses how the pedestal value is measured: Image minimum, Low percentile, or First non-zero value (see §2.2).
PercentileActive only in Low-percentile mode (0–50%, default 0.1%). The pixel-value percentile to subtract.
Per-channel (RGB)On: an independent pedestal for R, G and B (removes a background colour cast too). Off: one shared pedestal across all channels (preserves the relative channel offsets).
Auto display stretch (preview only)Temporary screen stretch so you can see the effect on near-black linear data. It changes the preview only — never the data that gets applied.
Preview / Apply to DocumentPreview recomputes the readout and image; Apply writes the result with an undo step named “Pedestal Removal”.
Zoom Out / In / Fit, wheel, dragPreview navigation (Ctrl+wheel zooms finer).
Grip (bottom-left)Drag to the canvas to mint a Remove-Pedestal shortcut with these settings, or drop on an image to apply headlessly.

The readout under the controls reports, per channel, the exact value being subtracted and how many pixels that subtraction drives below zero (clamped to black), with a percentage — so you can see immediately if a pedestal is too aggressive.

2. Technical details

What each mode measures and exactly how the subtraction is applied.

2.1 Input preparation

The image is taken as float32. Absurd out-of-range data (a maximum above 5, e.g. raw ADU that was never normalised) is scaled down first so a min-subtract behaves sensibly; already-normalised [0, 1] data is untouched:

x = float32(img) if max(x) > 5: x = x / max(x) # else no-op

2.2 The pedestal value

For each channel c the scalar to subtract, v_c, is one of:

\mathrm{Image\ minimum}:\quad v=\min(x)
\mathrm{Low\ percentile}:\quad v=\mathrm{percentile}(x,\,p)\qquad(p\ \mathrm{in}\ \%,\ \mathrm{default}\ 0.1)
\mathrm{First\ non\text{-}zero}:\quad v=\min\left(x[x>0]\right)\qquad(0\ \mathrm{if\ none})

Why three modes:

2.3 Applying the subtraction

The pedestal is subtracted and the result clamped to the valid range; pixels that would go negative are counted as clamped-to-black:

\mathrm{out}_c=\mathrm{clip}(x_c-v_c,\,0,\,1)\,,\qquad \mathrm{clamped}_c=\#\{\,x_c

Because the operation is a pure constant offset per channel, it is linear and preserves relative pixel differences above the floor — it moves the black point, it does not stretch or compress the data.

2.4 Per-channel vs global

With Per-channel on, v_R, v_G, v_B are measured independently, so an uneven background (a colour cast where one channel's floor is higher than another's) is neutralised as a side effect of zeroing each channel's floor. With it off, a single v is measured across all channels and subtracted uniformly, which preserves any channel-to-channel offset — use it when the cast is real signal you want to keep.

2.5 Masking

If the document has an active mask m (normalised to [0, 1] and resampled to the image size), the result is blended back against the original so the pedestal only affects masked regions:

\mathrm{out}=m\cdot\mathrm{out}+(1-m)\cdot\mathrm{src}

2.6 Output & preview