Edge Detect
Draws the edges in a texture as bright lines on a transparent background.
Outputs
| Name | Type | Description |
|---|---|---|
| Texture Output | Texture | The edges, white on transparent black. |
Inputs
| Name | Type | Description |
|---|---|---|
| Texture Input | Texture | The texture to find edges in. |
Parameters
| Name | Type | Description |
|---|---|---|
| Output Format | Enum | Whether the output takes the size and type of the input or uses the settings below.Choices: Copy Input, Manual |
| Texture Type | Enum | The channels of the output texture. Follows the input unless the output format is Manual.Choices: R (u8), RG (u8), RGBA (u8) |
| Texture Size | Vector 2 Int | The size of the output texture in pixels. Follows the input unless the output format is Manual. |
| Threshold | Float | How strong an edge has to be before it shows. 0 shows every edge, higher hides the faint ones. |
| Strength | Float | How bright the edges are drawn. |
| Sample Distance | Float | How 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