Threshold

Turns a texture into black and white by a cut at a chosen brightness.

Outputs

NameTypeDescription
OutputTextureWhite where the texture passes the threshold, black where it does not.

Inputs

NameTypeDescription
InputTextureThe texture to threshold.

Parameters

NameTypeDescription
ModeEnumWhich values come out white.Choices: Above, Below, Between, Outside
SourceEnumWhich value of a pixel is held against the levels. Luminance weighs the channels the way the eye sees them, and Per Channel thresholds red, green and blue each on their own.Choices: Luminance, Average, Red, Green, Blue, Alpha, Per Channel
ThresholdFloatThe level the cut is at, between 0 for black and 1 for white. Only present in Above and Below mode.
RangeVector 2The bottom and the top of the band, between 0 for black and 1 for white. Only present in Between and Outside mode.
SoftnessFloatHow wide the transition from black to white is, in the same units as the levels. 0 gives a hard cut.
FormatadvancedEnumThe pixel format of the output. Auto gives one channel of gray, or keeps the channels of the input when it has alpha or Source is Per Channel.

The Threshold operator turns a picture into black and white. Use it to make a mask of the bright parts of an image, or to give a picture a hard two-tone look.

In Above mode, everything brighter than the threshold turns white. In Below mode, everything darker does. In Between mode, only a band of brightness turns white, such as the mid tones. In Outside mode, that band turns black and the rest white.

On video a hard cut tends to flicker along edges. A little softness, around 0.05, calms it down without blurring the mask.

See also Compare, Grayscale.

Keywords: mask, binarize, posterize, cutoff, level, black and white, two tone, luma key