Edge Detect

Draws the edges in a texture as bright lines on a transparent background.

Outputs

NameTypeDescription
Texture OutputTextureThe edges, white on transparent black.

Inputs

NameTypeDescription
Texture InputTextureThe texture to find edges in.

Parameters

NameTypeDescription
Output FormatEnumWhether the output takes the size and type of the input or uses the settings below.Choices: Copy Input, Manual
Texture TypeEnumThe channels of the output texture. Follows the input unless the output format is Manual.Choices: R (u8), RG (u8), RGBA (u8)
Texture SizeVector 2 IntThe size of the output texture in pixels. Follows the input unless the output format is Manual.
ThresholdFloatHow strong an edge has to be before it shows. 0 shows every edge, higher hides the faint ones.
StrengthFloatHow bright the edges are drawn.
Sample DistanceFloatHow far apart the compared pixels are, in pixels. 1 gives thin lines, more gives thicker ones.

Edge Detect finds the places where the brightness of a texture changes quickly and draws them as lines. Smooth areas come out black and transparent, and every boundary between light and dark comes out bright. The result looks like a line drawing of the input.

Edges are found by comparing each pixel to its neighbours on brightness alone, so a change of color at the same brightness is not an edge. The threshold takes away the faint edges that come from noise or gentle gradients, the strength brightens what is left, and the sample distance makes the lines thicker by comparing pixels further apart.

The alpha of the result is the edge value too, so the lines can be laid straight over another texture with Blend or Mixer. Blurring the input first with Blur gives cleaner lines from a noisy image.

Keywords: outline, sobel, contour, lines, sketch, find edges