Description
Targeted saturation and hue adjustments, narrowband palettes (SHO, HOO, HSO, Foraxx), LRGB combination and Hα / OIII extraction from a colour sensor with a dual-band filter.
What it does
The plugin provides four post-processing stages (pipeline:) for astrostack (the CelestiaX application).
saturation: increases (or decreases) saturation through a luminance mask: the weight is 1 betweenlowandhighand smoothly falls to 0 below (sky background) and above (bright cores), with transitions of widthsoft. The gain1 + amount × weightmultiplies the a*/b* chrominance in CIELab (default, preserves brightness), or the saturation in HSV / HSL. Thehue_shiftrules then move selected hues on the HSV wheel (0 red, 120 green, 240 blue): triangular weight around thefromhue, over ±rangedegrees, towards thetohue; weakly saturated pixels (neutral background) are left alone.narrowband: builds an RGB image from separately stacked Hα, OIII and SII channels. Backgrounds are equalised (median removed, common pedestal) and, withnormalize, OIII and SII are brought to the scale of the Hα signal (99.5th percentile above background). Each channel is weighted (weights), optionally auto-stretched (stretch_inputs), then the palette is built:SHO(Hubble palette): R = SII, G = Hα, B = OIII;HSO: R = Hα, G = SII, B = OIII;HOO: R = Hα, G = B = OIII;Foraxx: Paulo Foraxx's dynamic palette, which blends Hα and OIII (and SII) pixel by pixel according to their intensity, for more natural gold / blue tones. Withha_to_red, the stage does something else: it adds the Hα excess (Hα scaled to the red channel, minus the red, floored at 0) to the red channel of an RGB image, weighted byamount.
lrgb: replaces the luminance of a colour image with a deeper L channel, in CIELab. L is first matched (median and highlights) to the luminance of the RGB image (match), then blended (l_weight); the a*/b* chrominance can be boosted (saturation).dualband: splits a colour image taken with a dual-band filter (L-eXtreme, L-eNhance, ALP-T…) into Hα = R and OIII = weighted mean of G and B. Both channels are written toctx.channels(usable afterwards bynarrowband) and the image becomes an HOO palette, the Hα channel alone, the OIII channel alone, or stays unchanged.
The ctx.channels channels
narrowband and lrgb read channels stacked per filter. To get them, set input: {group_by: filter} in the core configuration: astrostack stacks each filter read from the FITS FILTER keyword separately, on a common alignment reference, and stores the result in ctx.channels ({filter name: image}). Names are normalised: Ha, H, HALPHA → Ha; O3, OIII → OIII; S2, SII → SII; L, LUM → L; R, G, B. A channel with a different size is resized (Lanczos) with a warning. dualband creates the Ha and OIII channels itself from a colour image.
Why / when to use it
- Vespera, Seestar, colour sensor:
saturationafter stretching to bring a nebula to life without colouring the background noise or saturating the stars;hue_shiftto fix a colour cast (orange drifting to red, cyan to blue). - Colour sensor + dual-band filter (Seestar with its built-in LP filter, Vespera with a dual-band filter):
dualbandfor an HOO image, or to extract Hα and OIII and then applynarrowbandin Foraxx. - Mono SHO data (filter wheel with Hα / OIII / SII):
narrowbandwithgroup_by: filter. ClassicSHOpalette,HOOfor OIII-rich nebulae,Foraxxfor a softer rendering. - Hα on an RGB image (galaxy with HII regions, faint nebula):
narrowbandwithha_to_red. - Mono LRGB:
lrgbcombines a long luminance with shorter colour layers (possibly binned). - When not to use it:
saturationon a still-linear image (colours are invisible there, the luminance mask makes no sense);narrowband/lrgbwithoutgroup_by: filter(no channels: the stage is skipped);dualbandon an image taken without a dual-band filter (the red channel is then not Hα). - Recommended position:
dualband,narrowbandandlrgbaftercropandbackground, on the linear stack (except Foraxx, withstretch_inputs: true) and beforestretch;saturationon the stretched image.
Installation
astrostack plugin install color-tools
Or from the Plugins view of the CelestiaX application. No extra Python dependency (python_deps is empty): the plugin uses NumPy, OpenCV and PyYAML, already required by the astrostack core.
Parameters
saturation
| Name | Type | Default | Description |
|---|---|---|---|
amount |
float (−1 to 3) | 0.4 | Saturation gain (0 = none, negative = desaturate) |
low |
float (0–1) | 0.1 | Luminance below which nothing is saturated (background) |
high |
float (0–1) | 0.9 | Luminance above which nothing is saturated (cores) |
soft |
float (0.001–0.5) | 0.08 | Width of the luminance mask transitions |
space |
choice (lab, hsv, hsl) |
lab |
Colour space used for saturation |
hue_shift |
text (YAML), optional | empty | Hue rules: [{from: 0-360, to: 0-360, range: degrees, amount}] |
mask |
text, optional | empty | Post-processing mask (see below) |
In hue_shift, range defaults to 30 and amount to 1; a single rule can be given without brackets.
narrowband
| Name | Type | Default | Description |
|---|---|---|---|
palette |
choice (SHO, HOO, HSO, Foraxx) |
SHO |
Palette (SHO and HSO need SII; Foraxx: dynamic) |
weights |
3 floats | [1.0, 1.0, 1.0] |
Hα, OIII, SII weights |
equalize |
bool | true |
Equalise channel backgrounds |
normalize |
bool | true |
Bring OIII / SII to the scale of the Hα signal |
stretch_inputs |
bool | false |
Stretch each channel before combining (automatic) |
target_background |
float (0.02–0.5) | 0.15 | Target background of the channel stretch |
ha_to_red |
text, optional | empty | Add Hα to the red of an RGB image, e.g. {amount: 0.5} (or a plain number) |
lrgb
| Name | Type | Default | Description |
|---|---|---|---|
l_weight |
float (0–1) | 1.0 | Share of L in the final luminance |
saturation |
float (0–3) | 1.0 | Chrominance factor (a*, b*) |
match |
bool | true |
Match L to the RGB luminance before replacing it |
dualband
| Name | Type | Default | Description |
|---|---|---|---|
oiii_weights |
2 floats | [0.5, 0.5] |
G and B weights for OIII |
output |
choice (HOO, ha, oiii, keep) |
HOO |
Output image |
equalize |
bool | true |
Equalise backgrounds (HOO) |
normalize |
bool | true |
Bring OIII to the scale of Hα (HOO) |
The mask parameter
saturation accepts the astrostack core masks. The mask (0 to 1) is computed on the image before the stage and the result is before × (1 − m) + after × m. Short form or YAML dictionary: mask: "stars invert" (do not saturate the stars), mask: "object feather=8" (nebula only), mask: "color hue=[180,260]" (blues only). Types: luminance, color, stars, object, range, file, combine; common options invert, blur, strength.
YAML examples
Vespera nebula: saturation outside the stars, oranges pulled towards red:
pipeline:
- stretch: {}
- saturation:
amount: 0.6
mask: "stars invert"
hue_shift: [{from: 30, to: 0, range: 20, amount: 0.7}]
Mono SHO data stacked per filter, Hubble palette:
input: {lights: "lights/*.fits", group_by: filter}
pipeline:
# … masters, quality, register, stack, crop, background …
- narrowband: {palette: SHO, weights: [1.0, 1.2, 0.9]}
- stretch: {}
Colour sensor + dual-band filter, Foraxx rendering:
pipeline:
- dualband: {output: keep}
- narrowband: {palette: Foraxx, stretch_inputs: true, target_background: 0.15}
Outputs
saturation,lrgb: modifyctx.image(NaN borders are preserved bysaturation).narrowband:ctx.imagebecomes the RGB palette image (negative values clipped to 0). Withstretch_inputs, if the image has not been stretched yet,ctx.linearreceives the linear version of the palette. Withha_to_red, only the red channel ofctx.imageis modified.dualband: writesctx.channels["Ha"]andctx.channels["OIII"], then replacesctx.imageaccording tooutput.- No file is written; each stage prints a summary in the console. Stages lacking the required data (monochrome image for
saturation, missing channels fornarrowband/lrgb, non-colour image fordualband) are skipped with a warning.
Limitations
dualbandassumes an ideal split: the red channel also contains SII and continuum, and G/B mix Hα and OIII depending on the sensor response; it is not a true spectral separation.- Without SII,
narrowbandreplacesSHO/HSOwithHOO. Hα and OIII are mandatory. hue_shiftworks in HSV and ignores weakly saturated pixels; a cast on the grey background is better fixed with the corecolorstage.lrgbassumes L and RGB are aligned (same alignment reference, whichgroup_by: filterprovides).
Licences
- Plugin: MIT licence, © Erwan Sturzenegger.
- Dependencies (provided by the core): NumPy and SciPy (BSD), OpenCV (Apache 2.0), SEP (LGPL / BSD).
Steps provided
This plugin adds 4 steps to the pipeline.
| Step | Type | Role |
|---|---|---|
saturation Saturation & hues | Post-processing | Luminance-masked saturation; selective hue shifts. |
narrowband Narrowband palette | Post-processing | SHO / HOO / HSO / Foraxx from the Hα, OIII, SII channels; or Hα into red. |
lrgb LRGB combination | Post-processing | L luminance combined with RGB colour (CIELab). |
dualband Dual-band extraction | Post-processing | Hα = R, OIII = (G+B)/2 from a colour sensor with a dual-band filter. |
- Post-processing On the stacked image, replayable in the live preview.
Dependencies
No dependency beyond CelestiaX: the plugin works as soon as it is installed.
Versions
- 1.0.0 current
Initial release (extracted from the astrostack core)