star_protected_blend
Blend a stars-only image into a starless one, preserving star-core color while applying a screen blend elsewhere. Use adjustable thresholds to protect bright star cores from over-brightening and optionally restore original color ratios.
Instructions
Blend a stars-only image into a starless one in place, as a screen blend that turns colour-preserving in bright star cores. The mode follows, per pixel, the star layer's own luminance SL (the mean of its three channels). Below core_threshold_low: per-channel screen blend 1 - (1 - target) * (1 - stars * k). Above core_threshold_high: luminance-only screen blend, the target's colour scaled by the new over the old luminance and capped at max_value. Between them the two blend linearly. k = strength * prot, where prot falls linearly from 1 at core_threshold_low to min_strength_fraction at core_threshold_high. With pre_star_id, the bright-area colour ratios of that view are then restored over the same luminance ramp (see restore_star_color). Runs as 64-bit PixelMath truncated to [0,1]; reports the target's median and max before and after.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stars_id | Yes | Stars-only RGB view | |
| strength | Yes | Multiplier k on the star layer in the screen blend, before protection | |
| max_value | Yes | Upper cap on each channel of the colour-preserving blend, and of the colour restoration when pre_star_id is given | |
| target_id | Yes | Starless RGB view, modified in place | |
| pre_star_id | No | Optional: RGB view whose colour ratios are restored in bright areas after the blend; empty or absent = no restoration | |
| core_threshold_low | Yes | Star luminance SL at and below which the pure screen blend applies and protection is 1 | |
| core_threshold_high | Yes | Star luminance SL at and above which the pure colour-preserving blend applies and protection is min_strength_fraction; greater than core_threshold_low | |
| min_strength_fraction | Yes | Protection factor reached at core_threshold_high (strength is multiplied by it) |