restore_star_color
Restores the color ratios of a reference in bright target areas, preserving target luminance. Weighted blend from restore_start to restore_end, with channel cap.
Instructions
Restore the colour ratios of a reference view in the bright areas of a target, in place, keeping the target's luminance. Per channel: restored = min(reference[c] * Lt / max(Lr, 0.001), max_value), where Lt and Lr are the target's and the reference's channel means; it is weighted in linearly from 0 at reference luminance restore_start to 1 at restore_end. 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 |
|---|---|---|---|
| max_value | Yes | Upper cap on each restored channel | |
| target_id | Yes | RGB view to modify in place | |
| pre_star_id | Yes | Reference RGB view whose colour ratios are restored (open, same dimensions) | |
| restore_end | Yes | Reference luminance at and above which the restored colour fully replaces the target; greater than restore_start | |
| restore_start | Yes | Reference luminance at and below which the target is unchanged |