Overview
Turns the distance in pixels from a silhouette's outline into a grayscale gradient. It is a versatile foundation for effects driven by distance from an outline, including glows, inner shading, and contour patterns.
Usage tips
- The golden pattern for a glow is: silhouette → Distance (
Outside) →gradient_map(glow colors) → layer over the original withblend(Add). max_distancecontrols the reach of the effect. Use 4–8 for a glow, or 16 and above for a broad aura.- Choose
regionby intent:Outsidefor outward light or shadow,Insidefor inner edge shading, andBothfor contours or effects centered on the outline. - Shape membership uses a fixed threshold of 0.5 on the selected
source. An empty shape produces an opaque black distance map in every region mode. - For pixel-art-like steps, reduce the number of tones downstream (with a
posterize-style node) to produce a contour-like glow.
Related nodes
gradient_map— convert distance into color (commonly paired with this node)blend— layer the result over the original imageregion_distance— the RegionMap version of a distance mapmorphology— expand or shrink the shape itself instead of measuring distance
Reading the output
region |
Inside | Outline | Outside |
|---|---|---|---|
| Outside | White (1.0) | White | Darkens with distance from the boundary |
| Inside | Brighter toward the center | Black (0.0) | Black |
| Both | Above 0.5 through white | 0.5 | Below 0.5 through black |
Technical details
- Uses an approximate Euclidean distance calculated with a two-pass chamfer method (1 / √2 weights).
- Boundary pixels in the measured region have distance 0. Consequently, the Inside boundary is exactly 0 and the Both boundary is exactly 0.5.
Insidetreats the canvas edges as outside, so it still produces distances for a fully opaque tile.
Examples
- Glow: silhouette →
Distance(Outside)→Gradient Map(glow color ramp) → layer over the original withBlend(Add) - Inner shading:
Distance(Inside)→Gradient Mapto create a fill that is dark at the edge and bright at the center - Contours:
Distance(Both)→Posterizeto create stripes that follow the shape