Skip to content

Edge Detect

Node icon
Filter

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 Edge Detect node applied to a source image: original (left) and result (right).
Side-by-side comparison: the original image on the left and the same image after the Edge Detect node on the right.

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.

An old town street photo beside its Flow Lines, continuous dark ink lines along the house fronts, balconies and street lamps on white, with the sky left blank

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.

An old town street drawn as an ink and wash picture, sepia pen lines along the house fronts, balconies and street lamps over soft washes of color
  1. The wash. Wire a photo into Painterly and pick the Soft Wash look.
  2. 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.
  3. 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.

Pins

ImageImage
InputRequired
ImageImage
Output
AlphaMask
Output

Filter

TypeChoice
Default: Canny Range: Canny / Flow Lines

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.
WidthNumber · px/%
Default: 0.5 Range: 0.5–32.0 px / 0–3%
Type = Flow Lines

How wide the lines are

ThresholdNumber
Default: 0.15 Range: 0.00–1.00
Type = Flow Lines

How strong a change must be to draw a line. 0 draws every change; 1 only the strongest

Low ThresholdInteger
Default: 50 Range: 0–1000
Type = Canny

Lower Canny threshold. Pixels with gradient below this are rejected as non-edges

High ThresholdInteger
Default: 150 Range: 0–1000
Type = Canny

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

ApertureInteger
Default: 3 Range: 3–7
Type = Canny

Sobel kernel size used to compute gradients.

Larger values detect broader, smoother edges.

L2 GradientToggle
Default: false
Type = Canny

How gradient magnitude is measured.

  • On: L2 norm, more accurate.
  • Off: the faster L1 norm approximation.
Pre-BlurToggle
Default: false
Type = Canny

Apply a Gaussian blur before edge detection to reduce noise

Blur Kernel (px)Integer
Default: 3 Range: 3–41
Type = Canny

Gaussian kernel size for pre-blur. Must be odd (3-21)

Expand (px)Integer
Default: 0 Range: 0–32
Type = Canny

Expands detected edges by this kernel radius. A one-pixel line becomes about 1 + 2N pixels wide.

Diagonal coverage depends on Expansion Shape.

Expansion ShapeChoice
Default: Round Range: Round / Square / Diamond
Type = Canny

Shape of the expansion kernel: Round, Square, or Diamond

InvertToggle
Default: false

Invert the edge mask: swaps which pixels are treated as edges vs background

Color

EdgeColor (RGBA)
Default: rgba(255, 255, 255, 255)

Edge color

BackgroundColor (RGBA)
Default: rgba(0, 0, 0, 255)

Background color

  • 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.