Studio Yotsuba
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

Input Ports

NameTypeDescription
Original
original
Image
Required
Image used where the mask is black
Processed
processed
Image
Required
Image used where the mask is white (e.g. brightness-adjusted copy)
Mask
mask
Image
Required
Mask image. White uses the processed image, black keeps the original

Output Ports

NameTypeDescription
Image
output
Image
Blended result

Parameters

NameTypeDefaultRangeDescription / Options
Invert
invert
Bool
false—

Swap which side uses the processed image

Use Alpha
alpha_enabled
Bool
false—

Use the mask's alpha channel instead of luminance

Alpha interpolation
alpha_mode
Enum
Premultiplied—

How RGB is interpolated when the input alpha values differ

  • PremultipliedPremultiplied
    Blend in premultiplied-alpha space so fully transparent RGB does not create color fringes
  • StraightRGBAStraightRGBA
    Blend the raw RGBA channels independently, including RGB stored in transparent pixels
Outside
outside
Enum
Original—

What to do where the mask image does not cover the canvas

  • OriginalOriginal
    Areas beyond the mask keep the original image
  • ProcessedProcessed
    Areas beyond the mask use the processed image
  • TransparentTransparent
    Areas beyond the mask become 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