Appearance
Clamp
Limits every value in an image to a range — removes the negative values color-space conversions can leave behind, or caps bright HDR values.
Category: Color Menu path: Color > Clamp
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
in | imageRgba16f | input | Image to clamp |
out | imageRgba16f | output | Clamped image |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
minimum | scalar | 0.0 | Values below this are raised to it (when Clamp Minimum is on). |
maximum | scalar | 1.0 | Values above this are lowered to it (when Clamp Maximum is on). |
clampMinimum | boolean | true | Apply the minimum. |
clampMaximum | boolean | true | Apply the maximum. |
channels | string | RGB | RGB clamps color only; RGBA clamps alpha too. |
How It Works
Each red, green and blue value (and alpha, with RGBA) is limited to [minimum, maximum]. Color is clamped on straight (un-premultiplied) pixels, so an edge pixel is clamped to the same limits as the solid pixel next to it.
Usage Examples
Basic: Clean up after a color-space conversion
Converting between wide and narrow gamuts (for example ACEScg to sRGB) can produce small negative values in saturated colors, which then misbehave in blurs, glows and keys. Add a Clamp with the defaults right after the ColorSpace node.
Basic: Keep a glow from blowing out
Turn clampMinimum off, set maximum to a value like 4, and put the Clamp before a Glow to stop a few extremely hot pixels from dominating it.
Tips
- With only
clampMinimumon, Clamp removes negatives and leaves HDR highlights alone. - Clamping alpha (
RGBA) with a maximum below 1 makes the whole image partly transparent.
Related Nodes
- ColorSpace — conversions that can produce negative values
- Threshold — hard cutoff to black and white