Overview
For each pixel of the output, Custom Tool evaluates separate formulas for R, G, B and A. The formulas can reference the pixels of the inputs (in1-in8) at the same position or at custom positions, perform complex math, and use additional parameters (n1-n8 numbers, p1-p8 points).
Much more flexible than Channel Booleans (limited to standard operations) or Color Curves (which maps per channel without interaction). It also allows sampling at arbitrary positions (useful for custom distortions and warps).
Where to find this node
- Effects Library:
Tools > Misc > Custom Tool - Quick add: right-click in the Node Editor →
Add Tool > Misc > Custom Tool
How it works
- Pixel variables
r1,g1,b1,a1: RGBA values of the pixel at the same position in Image 1. Same for in2-in8.- Coordinate variables
x,y: normalized coordinates of the pixel (0-1). They enable position-based effects.- Parameters
n1-n8: custom scalar values (sliders).p1-p8: 2D points (custom x/y positions).- Sampling
getr1f(x, y)= R of in1 at position x,y. Enables sampling at arbitrary positions (distortions, warps).- Outputs
- Four formulas: R Expression, G, B, A. The result is the output pixel.
Inputs
- Image 1 (orange) - the main input.
- Image 2 to 8 - additional inputs for formulas with multiple inputs.
Setup
Simple color inversion: R = 1 - r1 G = 1 - g1 B = 1 - b1 A = a1 Mix between two images based on a Number: R = r1 * (1 - n1) + r2 * n1 G = g1 * (1 - n1) + g2 * n1 B = b1 * (1 - n1) + b2 * n1 A = a1 Procedural vignette: distance = sqrt((x - 0.5)^2 + (y - 0.5)^2) factor = 1 - distance * n1 R = r1 * factor ... Simple warp distortion: offset_x = sin(y * 10) * n1 R = getr1f(x + offset_x, y) G = getg1f(x + offset_x, y) B = getb1f(x + offset_x, y) A = a1 Absolute difference (debug): R = abs(r1 - r2) G = abs(g1 - g2) B = abs(b1 - b2) A = a1
Controls tab
- R / G / B / A Expressions
- One formula per channel. Each expression is evaluated on every pixel to produce the matching output channel.
- Number Controls (n1-n8)
- Customizable sliders. Animate them for time-based effects. They can be referenced in the expressions.
- Point Controls (p1-p8)
- Custom 2D points. Can be moved in the viewer. Useful for position-centered effects (a virtual spotlight).
- Setup (intermediate)
- Intermediate expressions run once per evaluation, which can be referenced in R/G/B/A. Useful for shared calculations.
Use cases
- Custom math effect - effects the standard nodes cannot do (a particular formula, a complex condition, vector math).
- Non-standard image combinations - a custom blend (for example, alpha mode + multiply, or bitwise operations), a weighted difference.
- Custom warp distortions - offset_x / offset_y computed from parameters = an arbitrary warp (more flexible than Displace).
- Debug visualization - display the difference between two versions, isolate an AOV channel to view it.
- Prototyping Fuses - test an algorithm in Custom Tool before packaging it as a reusable Fuse.
- Compositing math - custom premultiplication, chromaticity adjustments, specific gamut formulas.
- Stylized procedural effects - complex vignettes, custom radial fades, mathematical procedural patterns.
Tips
- Performance - Custom Tool evaluates per pixel. In 4K = 8M+ evaluations per frame. A significant cost if the formulas are complex.
- Setup for shared calculations - move calculations referenced in several channels into Setup so they are evaluated once.
- Normalized x, y coordinates - 0-1, independent of the resolution. Better for effects that hold up when resized.
- getr1f vs getr1 -
getr1f= bilinear sampling (smooth),getr1= exact pixel sampling (no interpolation). Prefer the f version for smooth warps. - Animate n1, p1 - the Number Controls are animatable. That enables time-based effects built into the Custom Tool.
- Document with comments - complex formulas quickly become unreadable. Use Sticky Notes next to the node to explain the math.
- Prefer a Fuse for reuse - if you use the same Custom Tool across several projects, package it as a Fuse for sharing and native performance.
- For truly hardcore effects (multi-pass, complex convolutions), go straight to Fuses (in C++ or Lua).
