Star Stretch

A fast, fixed-shape non-linear stretch tuned for stars: it lifts faint signal and compresses highlights so star cores don't blow out — with optional colour boost and green removal. One slider, one curve, no statistics to measure.

1. Using the tool

Set the stretch, optionally boost colour and remove green, then Preview and Apply to Document. The preview runs on a background thread; the view supports zoom/pan.

ControlWhat it does
Stretch Amount (0–8, default 5)The amount a in the curve below. 0 is identity (no change); larger values lift shadows/midtones harder.
Color Boost (0–2, default 1)A saturation-like boost (RGB only). 1.00 leaves colour unchanged; above 1 pushes each pixel's channels away from their mean.
Remove Green via SCNROptional average-neutral green removal to kill the green cast stars/background often pick up.
Preview / Apply to DocumentPreview computes in the background; Apply writes an undoable “Star Stretch” step.
Zoom Out / In / Fit, wheel, dragPreview navigation.
Grip (bottom-left)Drag to the canvas to mint a Star Stretch shortcut with these settings, or drop on an image to apply headlessly.

2. Technical details

One parameter, one rational curve, applied identically to every channel — the same midtones-transfer family as Statistical Stretch, but with the amount dialed in directly instead of solved from the data.

2.1 The core curve

The Stretch Amount is the parameter a of the midtones-transfer family; every pixel x ∈ [0,1] passes through:

f_a(x)=\frac{3^{a}\,x}{(3^{a}-1)\,x+1}

It is pinned at the endpoints and controlled entirely by a:

f_a(0) = 0 (black stays black) f_a(1) = 1 (white stays white) a = 0 -> identity (no stretch) a = 5 -> 3^5 = 243 (strong lift of faint signal)

With a > 0 the curve bends above the diagonal, so shadows and midtones are lifted while the approach to 1.0 flattens — faint nebulosity and the wings of stars come up, but bright star cores compress rather than clip, which keeps them tight. Nothing is measured and nothing is solved: the same amount always gives the same curve, instantly.

2.2 Relationship to Statistical Stretch

This is the same family as Statistical Stretch — and Statistical Stretch is literally the solution of it. If you ask which amount would place a measured (rescaled) median M exactly on a target T, the answer is closed-form:

a=\frac{\ln\left(\dfrac{T}{1-T}\cdot\dfrac{1-M}{M}\right)}{\ln 3}

Put that amount into f_a and it becomes, identically, the Statistical Stretch kernel:

\frac{3^{a}\,x}{(3^{a}-1)\,x+1}\;\equiv\;\frac{(M-1)\,T\,r}{M\,(T+r-1)-T\,r}

So the two tools share one transfer. Statistical Stretch solves a from your data so the median lands analytically on a chosen target; Star Stretch sets a directly from the slider — a quick, median-agnostic lift you dial by eye, ideal for star fields where you just want a pleasing, repeatable curve rather than a specific background level.

2.3 Colour boost

An optional, HSV-free saturation boost: each pixel's channels are pushed away from (or toward) their own mean C̄:

C'=\bar{C}+(C-\bar{C})\cdot\mathrm{boost}

A boost of 1.0 is a no-op; above 1.0 increases saturation, below 1.0 desaturates. Applied only to RGB images, after the stretch.

2.4 Green removal (SCNR)

Optional average-neutral SCNR clips the green channel so it never exceeds the average of red and blue — removing the green cast that stars and background commonly show without tinting neutral tones:

G'=\min\left(G,\;\frac{1}{2}(R+B)\right)

2.5 Notes