Skip to content

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 ​

PortTypeDirectionDescription
inimageRgba16finputImage to clamp
outimageRgba16foutputClamped image

Parameters ​

ParamTypeDefaultDescription
minimumscalar0.0Values below this are raised to it (when Clamp Minimum is on).
maximumscalar1.0Values above this are lowered to it (when Clamp Maximum is on).
clampMinimumbooleantrueApply the minimum.
clampMaximumbooleantrueApply the maximum.
channelsstringRGBRGB 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 clampMinimum on, Clamp removes negatives and leaves HDR highlights alone.
  • Clamping alpha (RGBA) with a maximum below 1 makes the whole image partly transparent.
  • ColorSpace — conversions that can produce negative values
  • Threshold — hard cutoff to black and white