Yotsuba Games
Back to Node List

Threshold

threshold

Turns an image into a clear black/white mask from brightness, alpha, or a chosen channel.

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
็”ปๅƒ
input
Image
Required
ๆ˜Žใ‚‹ใ„้ƒจๅˆ†ใ€็‰นๅฎšใฎ่‰ฒๆˆๅˆ†ใ€้€ๆ˜Žใงใชใ„้ƒจๅˆ†ใชใฉใ‚’ๅˆ†ใ‘ใŸใ„็”ปๅƒใงใ™ใ€‚

Output Ports

NameTypeDescription
ใƒžใ‚นใ‚ฏ
output
Image
็™ฝ้ป’ใƒžใ‚นใ‚ฏใงใ™ใ€‚็™ฝใŒ้ธใฐใ‚ŒใŸ้ƒจๅˆ†ใ€้ป’ใŒ้ธใฐใ‚Œใชใ‹ใฃใŸ้ƒจๅˆ†ใงใ™ใ€‚

Parameters

NameTypeDefaultRangeDescription / Options
ๅŸบๆบ–
source
Enum
OKLCH-Lโ€”

็™ฝ้ป’ใ‚’ๆฑบใ‚ใ‚‹ๅŸบๆบ–ใงใ™ใ€‚ๆ˜Žใ‚‹ใ•ใงๅˆ†ใ‘ใ‚‹ใชใ‚‰ OKLCH ๆ˜Žๅบฆใ€ๅฝขใ ใ‘ใชใ‚‰ Alphaใ€่‰ฒ็›ธ็ฏ„ๅ›ฒใชใ‚‰่‰ฒๅŸŸ้ธๆŠžใƒŽใƒผใƒ‰ใ‚’ไฝฟใ„ใพใ™ใ€‚

  • OKLCH ๆ˜ŽๅบฆOKLCH-L
    ่ฆ‹ใŸ็›ฎใฎๆ˜Žใ‚‹ใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚ๅฝฑใ‚„ใƒใ‚คใƒฉใ‚คใƒˆใชใฉใ€็›ฎใง่ฆ‹ใŸๆ˜Žๆš—ใซๅˆใ‚ใ›ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • OKLCH ๅฝฉๅบฆOKLCH-C
    ่‰ฒใฎ้ฎฎใ‚„ใ‹ใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚ใใ™ใ‚“ใ ่‰ฒใจ้ฎฎใ‚„ใ‹ใช่‰ฒใ‚’ๅˆ†ใ‘ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • HSV ๅฝฉๅบฆHSV-S
    HSV ใฎ้ฎฎใ‚„ใ‹ใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚ไธ€่ˆฌ็š„ใช่‰ฒ็›ธใƒปๅฝฉๅบฆใƒปๆ˜Žๅบฆใฎๆ„Ÿ่ฆšใง้ธใณใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • HSV ๆ˜ŽๅบฆHSV-V
    RGB ใฎไธ€็•ชๆ˜Žใ‚‹ใ„ใƒใƒฃใƒณใƒใƒซใ‚’ๅŸบๆบ–ใซใ—ใพใ™ใ€‚ๅ…‰ใฃใŸ่‰ฒใ‚„ๅŽŸ่‰ฒใฎๅผทใ•ใ‚’่ฆ‹ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • RGB ่ตคRGB-R
    ่ตคใฎๅผทใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚่ตคใฟใ ใ‘ใ‚’ๆŠœใๅ‡บใ—ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • RGB ็ท‘RGB-G
    ็ท‘ใฎๅผทใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚็ท‘ๆˆๅˆ†ใ ใ‘ใ‚’ๆŠœใๅ‡บใ—ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • RGB ้’RGB-B
    ้’ใฎๅผทใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚้’ๆˆๅˆ†ใ ใ‘ใ‚’ๆŠœใๅ‡บใ—ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • ใ‚ขใƒซใƒ•ใ‚กAlpha
    ้€ๆ˜Žๅบฆใงๅˆคๅฎšใ—ใพใ™ใ€‚ไธ้€ๆ˜Žใชๅฝขใ ใ‘ใ‚’ใƒžใ‚นใ‚ฏใซใ—ใŸใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
  • ่ผๅบฆLuminance
    RGB ใ‹ใ‚‰่จˆ็ฎ—ใ—ใŸๆ˜Žใ‚‹ใ•ใงๅˆคๅฎšใ—ใพใ™ใ€‚OKLCH ใ‚ˆใ‚Šๅ˜็ด”ใช็™ฝ้ป’ๅค‰ๆ›ใซ่ฟ‘ใ„็ตๆžœใŒๆฌฒใ—ใ„ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚
ใ—ใใ„ๅ€ค
threshold
Float
0.50โ€“1 / step 0.01

ไธŠใ’ใ‚‹ใปใฉ็™ฝใซใชใ‚‹็ฏ„ๅ›ฒใŒ็‹ญใใชใ‚Šใ€ไธ‹ใ’ใ‚‹ใปใฉๅบƒใ้ธใฐใ‚Œใพใ™ใ€‚

ๅ่ปข
invert
Bool
falseโ€”

้ธใฐใ‚Œใ‚‹้ƒจๅˆ†ใจ้ธใฐใ‚Œใชใ„้ƒจๅˆ†ใ‚’ๅ…ฅใ‚Œๆ›ฟใˆใพใ™ใ€‚

ใƒžใ‚นใ‚ฏใ‚’้€ๆ˜Žๅบฆใซใ™ใ‚‹
alpha_from_mask
Bool
falseโ€”

็™ฝ้ป’ใƒžใ‚นใ‚ฏ่‡ชไฝ“ใ‚’้€ๆ˜Žๅบฆใซใ‚‚ไฝฟใ„ใพใ™ใ€‚้ป’ใ„้ƒจๅˆ†ใฏ้€ๆ˜Žใ€็™ฝใ„้ƒจๅˆ†ใฏ่กจ็คบใ•ใ‚Œใพใ™ใ€‚ๅ…ƒ็”ปๅƒใฎ่‰ฒใฏไฟๆŒใ—ใพใ›ใ‚“ใ€‚

ๅฎŒๅ…จ้€ๆ˜Žใ‚’็„ก่ฆ–
ignore_fully_transparent
Bool
trueโ€”

ๅฎŒๅ…จ้€ๆ˜Žใชๅ…ฅๅŠ›ใƒ”ใ‚ฏใ‚ปใƒซใฏใ€ๅ†…้ƒจใฎRGBๅ€คใซใ‹ใ‹ใ‚ใ‚‰ใš้ธๆŠžใ—ใพใ›ใ‚“ใ€‚

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 โ†’ threshold for random spots and original image โ†’ threshold(Alpha) for a silhouette.
  • The go-to destinations are mask inputs on blend_by_mask, erase_by_mask, and mask-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 as color_select_replace.
  • Turn alpha_from_mask ON 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_transparent keeps fully transparent input pixels unselected regardless of hidden RGB. Graphs migrated from v1 retain the former false setting for compatibility.

Common pitfalls

  • The boundary flickers or looks unstable: values near the threshold are varying. Move threshold by ยฑ0.1 to find a stable point, or smooth the distribution with a light gaussian_blur upstream.
  • All intermediate tones disappear: this node intentionally binarizes. Use posterize or gradient_map(Steps) to retain multiple stages.
  • Black and white are reversed: simply turn invert ON; no upstream change is needed.

Examples

  • Use Alpha to make a mask where only opaque pixels are white.
  • Use OKLCH-L to extract only luminous areas.
  • Turn invert on to select only shadows or dark areas.

Related nodes

  • blend_by_mask / erase_by_mask โ€” primary destinations for the mask
  • noise_generate โ€” source for a random mask
  • posterize โ€” reduce to several stages instead of two
  • color_select_replace โ€” select and replace a specific color
Back to Node List
Threshold โ€” PixPipeline Node Reference