Match the brightness of channels (RGB) or of one image to another (mono) by scaling their medians to a common reference. A pure multiplicative gain — it equalises levels without clipping or distorting the linear data.
The dialog adapts to the active image: RGB images show a channel-target strategy; mono images show a reference-view picker. Results apply to the active view (OK runs it; a progress bar reports work).
| Control | What it does |
|---|---|
| Target channel (RGB) | Which channel's median the others are scaled to: Highest Median, Lowest Median, or an explicit Red / Green / Blue. |
| Reference view (mono) | Another open image whose median the active mono image is scaled to. If the reference is RGB, a luminance proxy is used (see §2.3). |
| Out-of-range handling | Clip to [0..1], Normalize to [0..1] if needed (default), or Leave values as-is — how to treat values pushed outside [0,1] by the scale. |
| Grip (bottom-left) | Drag to the canvas to mint a Linear Fit shortcut with these settings, or drop on an image to apply headlessly. |
The fit is a per-target multiplicative scale that matches medians. The median is used because it tracks the dominant background population and is insensitive to stars and hot pixels.
Each channel/image is modelled as differing from the reference by a single
gain factor (different filter throughput, exposure, or sensitivity). Matching a
robust central value — the median — aligns the overall level without
being skewed by the bright tail. The fit has no additive term: it is
y = s·x with zero intercept. (Removing an additive floor is a
separate operation — see Remove Pedestal.)
Per-channel medians m_c = median(x_c) are computed (nan-median), a
reference channel is chosen by the strategy (argmax(m) for highest,
argmin(m) for lowest, or a fixed R/G/B index), and every channel is
scaled so its median equals the reference's:
The reference channel is left unchanged (its scale is 1); the others are pulled to meet it, which equalises the channel backgrounds and removes a flat colour cast.
A mono image is scaled so its median matches a reference image's median. If the reference is colour, its median is taken on a Rec.709 luminance proxy:
Because scaling can push values past 1.0 (or a negative input below 0), the result is post-processed by the chosen mode:
“Normalize if needed” (the default) only rescales when values actually left [0,1], so well-behaved data passes through untouched while over-range results are brought back without hard clipping.