Overview
Converts an image into a black-and-white mask of selected and unselected areas. Use it to extract only bright, nontransparent, or strongly red areas.
Raising threshold narrows the white range; lowering it widens the range.
Usage tips
- The shortest mask routes are
noise_generate → thresholdfor random spots andoriginal image → threshold(Alpha)for a silhouette. - The go-to destinations are mask inputs on
blend_by_mask,erase_by_mask, andmask-family nodes. - Start with the default
OKLCH-L, perceived brightness, for selecting bright areas. Switch to RGB/HSV only when extracting a specific color component. For a circular hue range that crosses red, use a color-selection node such ascolor_select_replace. - Turn
alpha_from_maskON to make the black side transparent while creating the mask, producing a transparent-background black/white mask. It does not retain the original image colors. ignore_fully_transparentkeeps fully transparent input pixels unselected regardless of hidden RGB. Graphs migrated from v1 retain the former false setting for compatibility.- For a photo or scan with uneven lighting, switch to
method=LocalMean. Start withlocal_radius=8andlocal_bias=0.05; turninvertON when extracting dark ink. - Radius is the scale of lighting variation. Keep it wider than the line being extracted but narrower than the broad shadow. Lower it when lines spread; raise it toward 16–32 when a large lighting gradient remains.
- Bias is subtracted from the neighborhood average. Raising it broadens white before
inversion. With
invertON for dark ink, raising it instead rejects faint marks and keeps only stronger dark differences. - Use
boundary=Wrapfor a tile so neighborhoods cross opposite edges. KeepClampfor an ordinary standalone photo or scan.
Common pitfalls
- The boundary flickers or looks unstable: values near the threshold are varying.
Move
thresholdby ±0.1 to find a stable point, or smooth the distribution with a lightgaussian_blurupstream. - One shaded half of a photo becomes the mask: the global cutoff is reading lighting
as content. Switch to
LocalMean, then start near radius 8–16 and bias 0.03–0.10. - Thin lines disappear in LocalMean: for dark lines with inversion, lower
local_bias. If the mask spreads around a line, lowerlocal_radiusslightly as well. - All intermediate tones disappear: this node intentionally binarizes. Use
posterizeorgradient_map(Steps)to retain multiple stages. - Black and white are reversed: simply turn
invertON; no upstream change is needed.
Examples
- Use
Alphato make a mask where only opaque pixels are white. - Use
OKLCH-Lto extract only luminous areas. - Turn
inverton to select only shadows or dark areas. - Binarize a shaded paper scan with
LocalMean(radius:8, bias:0.05, invert:ON)to remove the paper shadow while retaining dark ink as a white mask.
Related nodes
blend_by_mask/erase_by_mask— primary destinations for the masknoise_generate— source for a random maskposterize— reduce to several stages instead of twocolor_select_replace— select and replace a specific color