Dilate / Erode
Dilate / Erode
Use Dilate / Erode to expand white mask regions with positive amounts or contract them with negative amounts. Distance mode gives hard binary morphology; Blur mode uses a softened neighborhood method before restoring a binary mask.
Availability
This node requires Pro.
Common uses
- Connect a binary or thresholded grayscale mask to Input.
- Use positive values to dilate and negative values to erode.
Input ports
-
input -
Expects a grayscale binary mask on the Input port.
Output ports
-
out -
Outputs a binary grayscale mask on Out.
Parameters
| Parameter | Type | Default | Range or values |
|---|---|---|---|
| Amount | float | 0 | -64 to 64 |
| Blur Scale | float | 0 | -64 to 64 |
| Mode | enum | distance | distance, blur |
Behavior
- The signed amount controls direction and radius.
- Distance and Blur modes share the same signed amount contract and have CPU/GPU implementations.
Common mistakes
- Non-binary inputs are thresholded at 50%.
- Large radii can be expensive on the CPU path.