Files
tono/docs/nodes/Custom Convolution.md
2026-03-30 23:10:42 -07:00

31 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Custom Convolution
Apply a user-defined convolution kernel to a DATA_FIELD. Enter rows of space-separated numbers. Equivalent to Gwyddion convolution_filter.c.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input field to filter |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | DATA_FIELD | Filtered field |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| kernel | STRING (multiline) | "0 -1 0\n-1 5 -1\n0 -1 0" | Kernel rows, each as space-separated numbers on a new line |
| normalize | BOOLEAN | True | Divide the result by the sum of absolute kernel values to preserve amplitude |
| boundary | dropdown | reflect | Boundary handling: reflect, nearest, or wrap |
## Limitations
- Kernel must be a rectangle: all rows must have the same number of values.
- Maximum kernel size is 51×51; larger kernels are rejected.
- Non-finite values in the kernel are rejected and the input is returned unchanged.
- For large kernels, direct convolution can be slow; consider FFT Filter instead.