Aller au contenu

Channel Booleans Node

By Kriss Norde

Channel Booleans applies math operations between channels (Add, Subtract, Multiply, Divide, Min, Max, etc.). It also lets you remap / swap channels (R↔B, alpha ← luma...). A Swiss Army knife for manipulating RGBA and any auxiliary channel (AOVs, mattes, Z-depth).

Overview

Channel Booleans works pixel by pixel: for each output channel, you select an operation and the source channels to use. The result can combine two different images (main and secondary input), or manipulate a single image (swap, threshold).

Essential for: combining mattes (sum, intersection), copying the alpha of one image to another, extracting an auxiliary channel, building custom operations beyond the standard nodes.

Where to find this node

  • Effects Library: Tools > Deep Pixel > Channel Booleans
  • Quick add: right-click in the Node Editor → Add Tool > Deep Pixel > Channel Booleans

Available operations

Copy
Copies the source channel into the destination channel. For simple swaps (R←B, alpha←luma).
Add / Subtract
Pixel-by-pixel sum or difference. Combines or subtracts mattes / images.
Multiply / Divide
Per-channel multiplication / division. Multiply to intersect mattes (white×white=white, white×black=black).
Min / Max
The smaller / larger of the two channels. Max = union of mattes, Min = strict intersection.
Difference
Absolute value of the difference. Highlights what changes between two images.
And / Or / Xor (boolean)
Bitwise logical operations. Rarer, useful for data channels.

Inputs

  • Background (orange) - main image.
  • Foreground (green) - second image for two-source operations. Optional for swaps within one image.
  • Effect Mask (blue) - optional.

Setup

Combine two mattes (union):
MatteA ─┐
        ├── Channel Booleans (Operation = Max on Alpha)
MatteB ─┘    → combined matte

Intersection of mattes:
MatteA ─┐
        ├── Channel Booleans (Operation = Multiply on Alpha)
MatteB ─┘    → intersection matte

Copy alpha from FG to BG:
ImageA ─┐
        ├── Channel Booleans (Alpha BG ← Alpha FG)
ImageB ─┘    → ImageA with the alpha of B

Swap R↔B (inverted color channel):
Image → Channel Booleans (R ← B, B ← R)
     → image with red and blue swapped

Coverage into alpha:
Multilayer EXR → Channel Booleans (Alpha BG ← Coverage)
              → image with alpha = coverage AOV

Controls tab

Operation (default: Copy)
Math operation applied. Add, Subtract, Multiply, Divide, Min, Max, etc.
To Red / To Green / To Blue / To Alpha
For each output channel, choose which source channel feeds it (from RGB, alpha, luma, or auxiliary channels of FG or BG).
Op Channels (default: Color)
Which channels the operation applies to. Color = RGB, Alpha only, or all.
Enable Aux Channels (default: Off)
Enables processing of auxiliary channels (Z, normals, position, etc.) in addition to RGBA.

Use cases

  • Combining mattes - union (Max) of two rotos to merge them, intersection (Multiply) for the shared area.
  • Replacing alpha - take the alpha of one image and apply it as a matte on another.
  • Extracting an AOV channel - expose an auxiliary channel (Coverage, Z, custom AOV) in RGB for viewing / processing.
  • Difference detection - Operation = Difference between two versions = a matte of the changes.
  • Swapping channels - fix footage with swapped channels (rare but it happens with files from various sources).
  • Custom operations - when no specialized node exists, Channel Booleans lets you build the operation by hand.
  • Manual pre-multiply / un-premultiply - Multiply RGB by Alpha = pre-multiply, Divide RGB by Alpha = un-premultiply.

Tips

  • Max = OR of mattes, Multiply = AND, Subtract = partial XOR. Think in logic terms to combine roto/keyer mattes.
  • Op Channels = Alpha for mattes - remember to switch it when you only handle 1-channel mattes (avoids stray color changes).
  • 32-bit float for precision - Add / Multiply can overflow in 8-bit. Work in float to avoid clipping.
  • View channel by channel - the viewer can show only the alpha channel to check the result on a matte.
  • Chain them for complex operations - several Channel Booleans in a row to break down multi-step operations.
  • A substitute for Custom Tool - for many operations, Channel Booleans is enough and faster to set up than a Custom Tool.
  • For truly complex operations (more than 2 sources, custom formulas), move to the Custom Tool, which supports LUA expressions.