continuous_clamp
Prevents highlight clipping by adaptively compressing bright values above a per-pixel knee derived from blurred luminance, with soft exponential or hard cutoff modes.
Instructions
Compress bright values in place above a knee that varies per pixel. A luminance image (Rec.709 weights for colour) is blurred with a Gaussian of sigma blur_sigma and divided by its maximum, giving L in [0,1]; the knee is min_clamp + (max_clamp − min_clamp)·(1 − L), so it equals min_clamp where L = 1 and max_clamp where L = 0. mode soft: a value above the knee becomes knee + headroom·(1 − exp(−rate·(value − knee)/headroom)); mode hard: min(value, knee). The same expression is applied to every channel and the result is truncated to [0,1].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | soft: exponential compression above the knee; hard: values above the knee are set to the knee | |
| rate | No | Soft mode, required there: steepness of the exponential compression | |
| view_id | Yes | Target view to clamp (modified in place) | |
| headroom | No | Soft mode, required there: the most the output can exceed the knee | |
| max_clamp | Yes | Knee where the blurred luminance is 0 | |
| min_clamp | Yes | Knee where the blurred luminance is at its maximum | |
| blur_sigma | No | Gaussian blur sigma of the luminance mask, in pixels; omitted = max(60, round(image width / 100)) |