GeneralizedHyperbolicStretch (GHS)
GeneralizedHyperbolicStretch (GHS) turns linear data into a visible image. Unlike a fixed curve, GHS lets you decide around which brightness value contrast grows most, and limits the stretch below and above it.
Purpose
| Task | Setting |
|---|---|
| turn linear data into a non-linear image | initial stretch, SP on the background |
| darken the background without losing information | Transformation type Linear, Blackpoint |
| stretch a colour image without fading colours | Mode Colour |
WhyGHS rather than a single histogram stretch?
A HistogramTransformation lifts all tonal values with one fixed curve. GHS sets the range of strongest contrast gain (SP) freely and limits the stretch above (HP) and below (LP). Contrast is created exactly where the faint structures lie, without blowing out stars. Several small passes are easier to control than one large one, because you measure again after each.
Principle
- With a positive stretch (D > 0) the curve lies above the diagonal along its whole length: every value is raised, including the background. The background peak moves to the right.
- GHS only stretches; the black point stays at 0. Afterwards the background floats at a mid grey and the tonal range to its left stays empty – the image looks milky. SP and LP do not change this.
- A black point alone darkens the background but drags faint structures down with it as long as they are still close to the background.
- Hence the principle: alternate stretch and black point. The stretch pulls structure and background apart, the black point brings the background back down. Each repetition increases the distance.
- The auto-STF looks more contrasty than a pure GHS pass because it combines stretch and black point (approx. median − 2.8 × MAD).
Parameters
| Parameter | Short | Effect | Typical choice |
|---|---|---|---|
| Stretch factor (ln(D+1)) | D | strength of the stretch per pass | high for the initial stretch (linear background very dark), smaller later for finer control |
| Local intensity | b | concentration of contrast around SP; higher = more targeted | high for the initial stretch, lower later for an even lift |
| Symmetry point | SP | value around which contrast grows most | on the background peak – structure just above receives the most contrast |
| Protect shadows | LP | no additional contrast below it | prevents amplified noise below the background; does not prevent the background from brightening |
| Protect highlights | HP | limits the stretch above it | protects star cores and bright areas from clipping |
Operation
- Make a copy first; the linear original remains as a fallback.
- Enable the Real-Time Preview and reset the STF of the main image (Ctrl+F12). Otherwise the preview inherits the STF and stretches on top.
- The image must be 32-bit floating point (status bar of the main window: f32). In 16 bits a linear background of 0.0001 would have only a few levels – stretching creates posterisation. The preview shows its own format (e.g. i16), not that of the image.
Measuring values
- In the main image enable auto-STF (Ctrl+A) – it changes only the display, not the pixel values.
- With GHS open, click the spot with the left mouse button held down; values appear under Readout Data.
- Send to SP transfers the value. LP has no button of its own: enter the value or select LP under Fine adjustment.
- Reset the STF of the main image again.
- For a stable value use Edit → Readout Options: Probe size 9×9 or 15×15, Mean or Median, Apply Global. The median is more robust if a faint star lies in the probe area.
- Alternatively click the background peak in the GHS graph (zoom the graph; in a linear image the peak is at the far left).
- The peak moves right with each pass → measure again before every pass.
Typical applications
Initial stretch in cycles
1 Initial stretch (1–2 passes) SP = background, LP = 0
↓
2 Black point (Linear) up to just before the left foot of the peak
↓
3 Measure SP again, stretch SP = background, LP just below SP
↓
4 Black point (Linear) small step
↓
repeat 3–4 until structure is clearly separated and background is dark| Step | Transformation type | D | b | SP | LP | HP |
|---|---|---|---|---|---|---|
| 1 Initial stretch | Generalised Hyperbolic | 2–4 | 4–8 | background | 0 | 1.0 |
| 2 Black point | Linear | – | – | – | – | – |
| 3 Stretch | Generalised Hyperbolic | 1–3 | 2–4 | background (new) | just below SP | 0.95–1.0 |
| 4 Black point | Linear | – | – | – | – | – |
WhyLP just below SP from the second pass on?
After the first black point, only noise and the darkest structures lie below the background. LP prevents this range from gaining more contrast – and visible noise – with every pass. LP must never be above SP.
- With a very dark linear background (median around 10⁻⁴) the initial stretch needs several passes.
- Contrast passes with SP on faint structure are usually not useful: SP and background are too close, the background brightens as well, and stars bloat. Local contrast is better built later with Raises local contrast – structures that differ only slightly from their immediate surroundings stand out without shifting the global tonal values. Open fundamentals → or Remaps tonal values along a freely shaped curve – for contrast, saturation, hue and for shifting individual tonal ranges. Acts globally; locally only with a mask. Open fundamentals →.
Setting the black point
- Transformation type: Linear.
- Raise Blackpoint at most to just left of the left foot of the histogram peak, never up to the peak.
- Check in the preview: background darker, faint structures still visible.
Whyonly up to the foot?
Left of the foot there is only noise and very few pixels; a black point there costs no information. At the peak, half of the background would be clipped.
- Do not clip: no pile of pixels at zero on the left. Clipped pixels are lost.
- Alternative: HistogramTransformation, shadows slider; the dialog shows the share of clipped pixels – stay below about 0.01–0.05 %.
- Intermediate black points may be strong, the last one gentle: it decides how much room the dark areas keep in the final image.
Colour images: Colour mode
Section Colour Options:
| Element | Function |
|---|---|
| Mode | RGB: each channel independently – colours fade. Colour: all channels of a pixel in the same ratio – saturation is kept |
| Clip type | handling of values above 1; default RGBBlend |
| Colour blend | 1.000 = pure Colour mode, lower values mix in RGB |
| Use RGB working space | weights by the luminance coefficients of the working space |
Setting: Mode Colour, Colour blend 1.000, Use RGB working space enabled – check before every pass. Irrelevant for monochrome images.
WhyColour mode?
A stretch is a non-linear curve. Applied to each channel separately, it changes the channel ratios of a pixel: the darkest channel is raised most in relative terms and all colours drift towards grey. In Colour mode a weighted average is stretched and every channel is scaled by the same factor – the colour is preserved. Use RGB working space weights by brightness sensitivity (green more strongly), so the stretch follows perceived brightness.
Monochrome images: applying the auto-STF
Quick alternative without GHS:
- Linear image, auto-STF (Ctrl+A).
- Drag the STF triangle onto the bottom bar of HistogramTransformation.
- Reset the STF (Ctrl+F12), apply HistogramTransformation.
Greyscale images only: the auto-STF stretches each channel separately and would reduce saturation in colour images. It places the background rather bright (around 0.25); if needed, a small black point step.
What a good result looks like
Typical errors
| Observation | Cause | Remedy |
|---|---|---|
| Stars clipped, bloated | HP too high, D too large | lower HP, reduce D per pass |
| Background milky, flat | black point missing | pass with Linear and Blackpoint |
| Structure disappears after the black point | structure still too close to the background | undo the black point, stretch further, then try again |
| Colours pale | Mode RGB | Mode Colour with Use RGB working space |
| Structure flat | too few cycles | another cycle of stretch + black point |
| Posterisation, tonal breaks | image in 16 bits | convert to 32-bit floating point, stretch again |
| Preview looks too bright | STF active in the main image | Ctrl+F12 |
When to use it – and when not
| Good for | Better another tool |
|---|---|
| stretching linear data in a controlled way | quick greyscale stretch → auto-STF via HistogramTransformation |
| darkening the background without clipping | matching tonal ranges in a non-linear image → Remaps tonal values along a freely shaped curve – for contrast, saturation, hue and for shifting individual tonal ranges. Acts globally; locally only with a mask. Open fundamentals → |
| stretching a colour image while keeping saturation | local contrast → Raises local contrast – structures that differ only slightly from their immediate surroundings stand out without shifting the global tonal values. Open fundamentals → |
CurvesTransformation · HaLRGB workflow · Narrowband workflow (HOO/SHO) · OSC workflow with a quad band-pass filter · StarXTerminator (SXT)