Oink
Clamp Clamp

Clamp

Clamp channel values to a range.

raw .md
NodeClamp
MenuColor › Clamp
Names in each format
.oink comp (JSON)"type": "OC_N_clamp"
.nk scriptClamp (how .nk import works)
Pythonnuke.createNode("Clamp")
Assistant (MCP)create_node(type="Clamp")
Tab searchclamp

Clamp properties

Inputs and outputs

PortNameType
input 0Imageimage
input 1maskimage
output 0Imageimage

Knobs

Panel tab Clamp, in panel order.

KnobLabelTypeDefaultRange / values.nk knobDescription
channelschannelsmenuallrgba, rgb, alpha, all, noneLayer the op applies to: rgb, rgba, alpha, all, none, <layer> or <layer>.<ch>
minimumminimumcolour ×40, 0, 0, 00 to 1minimum
minimum_enableenable minimumbooltrueminimum_enable
maximummaximumcolour ×41, 1, 1, 10 to 1maximum
maximum_enableenable maximumbooltruemaximum_enable
MinClampToMinClampTocolour ×40, 0, 0, 00 to 1MinClampTo
MinClampTo_enableenable MinClampToboolfalseMinClampTo_enable
MaxClampToMaxClampTocolour ×41, 1, 1, 10 to 1MaxClampTo
MaxClampTo_enableenable MaxClampToboolfalseMaxClampTo_enable
mask_channelmaskmenunonenone, rgba.alpha, rgba.red, rgba.green, rgba.blueMask channel, e.g. rgba.alpha (none = no mask)
injectinjectboolfalseCopy the mask into mask.a for nodes downstream
invert_maskinvertboolfalseinvert_mask
fringefringeboolfalseOnly apply the effect at the edges of the mask
unpremult(un)premult bymenunonenone, rgba.alpha
invert_unpremultinvertboolfalse(Un)premultiply by 1 - alpha
mixmixfloat10 to 1mix

Other knobs (Python, .nk and the assistant; not on the panel)

KnobLabelTypeDefaultRange / values.nk knobDescription
gl_colorViewer Controls Colorfloat ×30, 0, 00 to 1
postage_stamp_frameStatic Frameint1-2147483648 to 2147483647
lifetimeStartLifetime Startint0-2147483648 to 2147483647
lifetimeEndLifetime Endint100-2147483648 to 2147483647
useLifetimeUse Lifetimebooleanfalse
cachedCachedbooleanfalse
bookmarkBookmarkbooleanfalse
dope_sheetDope Sheetbooleanfalse
clone_groupClone Groupstring
link_sourceLink Sourcestring
link_overridesLink Overridesstring
split_viewsSplit Viewsstring

Examples

Open these from Help › Examples…, or from the ? menu in this node's Properties panel.

  • Bright values, NaN and inf (examples/io/read_hdr_nan_inf.oink): TestImages/BrightRingsNanInf.exr has rings brighter than 1000 and a few NaN / inf pixels in the middle. Oink never clamps in the pipeline, so they reach the Viewer as they are. The Clamp limits the rings to 0-1; the NaN pixels stay NaN (look at them with the Viewer's pixel readout), which is why you fix NaNs at the source before a blur spreads them.

On this page