Overview
A free-form node that calculates R/G/B/A with an expression for every pixel (equivalent to Pixel Processor in Substance Designer). Build image processing that has no dedicated node—custom blends, mathematical patterns, or channel operations— with four expressions. It evaluates the same expression syntax as Expression Float, once per image pixel.
Usage tips
- When the filter you need does not exist, start here. You can reference two images
through values such as
r2, so expressions can implement composites not covered by existingblendmodes. - Coordinates
u/v(0–1) andtimecan produce animated procedural patterns (for example,sin((u + time) * pi * 8) > 0creates moving stripes). - First confirm the coordinate system with a debug gradient such as
expr_r: u, expr_g: v; then write the actual expression. - When a dedicated node can do the job (brightness adjustment, thresholding, and so on), it is faster and easier to read.
Related nodes
expression_float— numeric version with the same syntax (useful for practicing expressions)blend— use this for standard compositescoordinates— when you only need a coordinate mapchannel_split/channel_merge— dedicated channel-operation nodes
Available variables
| Variable | Meaning |
|---|---|
x, y |
Pixel coordinates (0 to width−1 / 0 to height−1) |
u, v |
Normalized coordinates (0–1) |
w, h |
Image width and height |
r, g, b, a |
Color of the current pixel in image A (0 when unconnected) |
r2, g2, b2, a2 |
Color of the current pixel in image B |
time, frame, total_frames |
Animation timing information |
Functions and operators are shared by all Expression nodes (arithmetic,
comparisons, && / ||, sin / cos / abs / min / max / floor, and so on).
Examples
- UV gradient with no image input:
expr_r: u,expr_g: v,expr_b: 0,expr_a: 1→ an opaque debug gradient - Swap channels:
expr_r: b,expr_b: r→ swap red and blue - Compare and composite two images: build a custom blend with expressions such as
expr_r: max(r, r2) - Procedural pattern:
expr_r: sin(x * 0.5) * 0.5 + 0.5→ stripes - Threshold mask:
expr_a: (r + g + b) / 3 > 0.5→ only bright areas remain opaque
Notes
- When image B is smaller than image A, sampling beyond B repeats B's last column
and last row for
r2/g2/b2/a2. &&/||skip the right side once the result is known, andif(condition, A, B)evaluates only the selected branch.- Reversed
clampbounds are swapped,sign(0) = 0, and%is a non-negative Euclidean remainder. Division or modulo by zero andsqrtof a negative value produce an error. - Expressions run for every pixel, so large images take time to process (pixel-art dimensions are recommended).
- An invalid expression produces an error. Start by testing a simple expression.