Yotsuba Games
Back to Node List

Blend By Mask

blend_by_mask

Mixes the original and a processed image using a mask โ€” the standard way to apply any adjustment locally

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
ๅ…ƒ็”ปๅƒ
original
Image
Required
ใƒžใ‚นใ‚ฏใŒ้ป’ใ„ๆ‰€ใงไฝฟใ†็”ปๅƒใงใ™
ๅ‡ฆ็†ๅพŒ็”ปๅƒ
processed
Image
Required
ใƒžใ‚นใ‚ฏใŒ็™ฝใ„ๆ‰€ใงไฝฟใ†็”ปๅƒใงใ™๏ผˆไพ‹: ๆ˜Žใ‚‹ใ•่ชฟๆ•ดใ—ใŸ็‰ˆ๏ผ‰
ใƒžใ‚นใ‚ฏ
mask
Image
Required
ใƒžใ‚นใ‚ฏ็”ปๅƒใงใ™ใ€‚็™ฝใ„ๆ‰€ใŒๅ‡ฆ็†ๅพŒใ€้ป’ใ„ๆ‰€ใŒๅ…ƒ็”ปๅƒใซใชใ‚Šใพใ™

Output Ports

NameTypeDescription
็”ปๅƒ
output
Image
ๆททๅˆ็ตๆžœใฎ็”ปๅƒใงใ™

Parameters

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

็™ฝ้ป’ใ‚’ๅ…ฅใ‚Œๆ›ฟใˆใ€้ป’ใ„ๆ‰€ใซๅ‡ฆ็†ๅพŒ็”ปๅƒใ‚’ไฝฟใ„ใพใ™

Alphaใ‚’ไฝฟ็”จ
alpha_enabled
Bool
falseโ€”

ใƒžใ‚นใ‚ฏใฎ่ผๅบฆใงใฏใชใใ‚ขใƒซใƒ•ใ‚กใƒใƒฃใƒณใƒใƒซใ‚’ไฝฟ็”จใ—ใพใ™

ใ‚ขใƒซใƒ•ใ‚ก่ฃœ้–“
alpha_mode
Enum
Premultipliedโ€”

ๅ…ฅๅŠ›็”ปๅƒใฎใ‚ขใƒซใƒ•ใ‚กๅ€คใŒ็•ฐใชใ‚‹ๆ™‚ใซRGBใ‚’ใฉใ†่ฃœ้–“ใ™ใ‚‹ใ‹ใ‚’้ธใณใพใ™

  • ไน—็ฎ—ๆธˆใฟใ‚ขใƒซใƒ•ใ‚กPremultiplied
    ไน—็ฎ—ๆธˆใฟใ‚ขใƒซใƒ•ใ‚ก็ฉบ้–“ใงๆททๅˆใ—ใ€ๅฎŒๅ…จ้€ๆ˜Žใƒ”ใ‚ฏใ‚ปใƒซใฎRGBใซใ‚ˆใ‚‹่‰ฒ็ธใ‚’้˜ฒใŽใพใ™
  • ใ‚นใƒˆใƒฌใƒผใƒˆRGBAStraightRGBA
    ้€ๆ˜Žใƒ”ใ‚ฏใ‚ปใƒซใซไฟๅญ˜ใ•ใ‚ŒใŸRGBใ‚’ๅซใ‚ใ€RGBAใฎๅ„ใƒใƒฃใƒณใƒใƒซใ‚’ๅ€‹ๅˆฅใซๆททๅˆใ—ใพใ™
ใƒžใ‚นใ‚ฏๅค–ใฎๆ‰ฑใ„
outside
Enum
Originalโ€”

ใƒžใ‚นใ‚ฏ็”ปๅƒใŒใ‚ญใƒฃใƒณใƒใ‚นใ‚ˆใ‚Šๅฐใ•ใ„ๆ™‚ใ€็ฏ„ๅ›ฒๅค–ใ‚’ใฉใ†ๆ‰ฑใ†ใ‹ใงใ™

  • ๅ…ƒ็”ปๅƒOriginal
    ใƒžใ‚นใ‚ฏใฎ็ฏ„ๅ›ฒๅค–ใฏๅ…ƒ็”ปๅƒใฎใพใพๆฎ‹ใ—ใพใ™
  • ๅ‡ฆ็†ๅพŒ็”ปๅƒProcessed
    ใƒžใ‚นใ‚ฏใฎ็ฏ„ๅ›ฒๅค–ใฏๅ‡ฆ็†ๅพŒ็”ปๅƒใ‚’ไฝฟใ„ใพใ™
  • ้€ๆ˜ŽTransparent
    ใƒžใ‚นใ‚ฏใฎ็ฏ„ๅ›ฒๅค–ใฏ้€ๆ˜Žใซใ—ใพใ™

Overview

PixPipeline correction nodes such as Brightness and Gaussian Blur do not have their own mask inputs (the local-correction principle in ยง2.8). Instead, use this node to combine a globally corrected version with the original through a mask.

Original โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”œโ”€ [Blend By Mask] โ”€โ†’ Result
Original โ†’ [Brightness] โ”€โ”€โ”˜        โ†‘
Mask โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technical details

  • A mask value from 0 to 1 linearly interpolates original โ†’ processed, so a grayscale mask can control partial strength.
  • Use the default Premultiplied mode for ordinary image compositing. It ignores RGB hidden in fully transparent pixels, avoids dark or colored fringes, and canonicalizes a zero-alpha result to transparent black.
  • Choose StraightRGBA only when the raw RGBA values, including transparent RGB, must be interpolated independently. Existing v2 projects migrate to this mode to preserve their previous output.
  • If the processed image is smaller than the canvas, areas outside it are treated as transparent during blending.

Usage tips

  • When you want to brighten or blur only one area, do not look for a mask input on the correction node. Always build this pattern: original + globally corrected version
    • mask. This is the standard PixPipeline approach.
  • Branch the original image in two, correct only one branch, then merge both in this node. This Y-shaped merge is the visual signature to look for in the graph.
  • A grayscale mask also supports partial application, such as 50% strength, through linear interpolation.
  • Keep Premultiplied for visual compositing; reserve StraightRGBA for compatibility or workflows that intentionally edit hidden transparent RGB.
  • Common combinations are also available as official custom nodes such as MaskedBrightness.

Common pitfalls

  • original and processed are reversed: processed appears in white mask areas. If the effect is reversed, swap the connections or turn invert ON.
  • A small mask behaves strangely at the edge: use outside to explicitly choose how areas outside the mask are handled (original, processed, or transparent).
  • Preparing three inputs feels cumbersome: branch from the same image; you do not need to draw the original twice.

Examples

  1. Local brightness adjustment: combine the original and its Brightness version only in an area drawn with Path Mask.
  2. Partial blur: blend a Gaussian Blur version with a soft mask from Histogram Scan for a depth-of-field look.
  3. Official custom nodes: MaskedBrightness / MaskedBlur / MaskedHSVAdjust are wrappers around this node.

Related nodes

  • mask / erase_by_mask โ€” cut out or erase instead of blending
  • threshold / path_mask โ€” mask sources
  • blend โ€” full-image blending without a mask
  • mask_boolean โ€” combines multiple masks
Back to Node List
Blend By Mask โ€” PixPipeline Node Reference