Edge Detect
Finds where a picture changes and draws it as thin Canny edges or smooth ink lines that follow its forms, for line art, ink drawings, and masks.
The output draws the edges in the Edge color over the Background color (white on black to start), and a separate Alpha output carries the edges as a single-channel image for use as a mask. Type picks how the edges are found:
- Canny (the default): thin, one-pixel edges wherever the picture changes sharply, set with Low Threshold and High Threshold. An Edge Detect saved before Flow Lines existed is Canny and looks exactly as it did.
- Flow Lines: smooth ink lines that follow the forms in the picture, like a pen drawing. See Flow Lines.
Canny edges are one pixel wide. Expand grows them outward by a pixel radius into a usable stroke weight, and Expansion Shape decides how corners and diagonals grow: Round keeps a uniform radius in every direction, Square grows along both axes to full width, and Diamond grows fastest along the axes and slowest on the diagonals.
Low Threshold, High Threshold, Aperture, L2 Gradient, Pre-Blur, Expand, and Expansion Shape are Canny’s rows and hide under Flow Lines.
Flow Lines
Section titled “Flow Lines”Flow Lines draws each line along the way the picture’s edges run, so a line stays continuous along a contour instead of breaking into dots, and it sits on the darker side of each change, the way an ink outline does. A smooth gradient such as a clear sky draws nothing.
- Width is how wide the lines are. It starts at 0.5 percent of the picture’s shorter side, so the lines look the same at any resolution; click the unit button to set it in pixels.
- Threshold (0 to 1, 0.15 to start) is how strong a change must be to draw a line. At 0 every change draws; at 1 only the strongest edges do.
Strong edges draw solid lines and fainter ones fade in, so a line tapers where its edge weakens. Invert and the two colors work as they do for Canny; with Invert on, the lines take the Background color.
Recipe: ink and wash
Section titled “Recipe: ink and wash”- The wash. Wire a photo into Painterly and pick the Soft Wash look.
- The ink. Wire the same photo, not the wash, into Edge Detect set to Flow Lines. Set the Edge color to a sepia or near black and the Background color to white.
- Together. In a Composite, put the wash at the bottom and the lines over it in Multiply: the white drops out and only the ink shows.
Reading the photo keeps the pen’s detail, the way a sketcher draws from the subject. Wiring the wash into Edge Detect instead draws fewer, softer lines that follow the paint strokes; lower Threshold to bring more of them in. Raise Threshold to keep only the bold edges, such as window frames and rooflines, and raise Width for a broader pen.
Parameters
Section titled “Parameters”Pins
Filter
How edges are found.
- Canny: thin, one-pixel edges wherever the picture changes sharply.
- Flow Lines: smooth ink lines that follow the forms in the picture, drawn on the darker side of each change.
How wide the lines are
How strong a change must be to draw a line. 0 draws every change; 1 only the strongest
Lower Canny threshold. Pixels with gradient below this are rejected as non-edges
Upper Canny threshold. Pixels above this are immediately accepted as edges. Pixels between Low and High are accepted only if connected to a strong edge
Sobel kernel size used to compute gradients.
Larger values detect broader, smoother edges.
How gradient magnitude is measured.
- On: L2 norm, more accurate.
- Off: the faster L1 norm approximation.
Apply a Gaussian blur before edge detection to reduce noise
Gaussian kernel size for pre-blur. Must be odd (3-21)
Expands detected edges by this kernel radius. A one-pixel line becomes about 1 + 2N pixels wide.
Diagonal coverage depends on Expansion Shape.
Shape of the expansion kernel: Round, Square, or Diamond
Invert the edge mask: swaps which pixels are treated as edges vs background
Color
Edge color
Background color
Usage Tips
Section titled “Usage Tips”- For a pen drawing, use Flow Lines; for a one-pixel outline or a mask of every edge, use Canny.
- Turn on Pre-Blur to reduce noise before detection, for cleaner edges with fewer false ones.
- Lower thresholds detect more edges (including noise); higher thresholds keep only strong edges.
- Set the Edge and Background colors for colored line art. The background is opaque black by default; set Background A to 0 for edges over transparency.
- If the node reports No edges detected, lower the thresholds. The warning also shows with Invert on, where the result would otherwise look like a plain full frame.