Slope

Detect edges and compute slope gradients from images.

What it does

Slope measures how quickly brightness changes from pixel to pixel and turns that change into colour. Method picks the operator: Sobel for the best quality, Prewitt for a faster pass, Laplacian for edges that favour no direction. Output picks what is packed: the default Slope mode stores horizontal change, vertical change, edge strength and edge angle together in one image, or isolate Magnitude (edge strength as grey), Direction (edge angle as colour), or a single X or Y gradient.

Slope also reads a Volume, tracing the same gradient in three dimensions, where Direction packs magnitude, azimuth and elevation instead of a flat angle. Fed a 3D scene rather than an image, it renders the scene's depth, normals or object silhouettes first and finds edges in that.

When to use it

ParameterTypeDefault
content_inOneOf([FieldOf(Color), FieldOf(Volume), Collection])
cameraOneOf([Camera3D])
sourceString"Color"
methodString"Sobel"
outputString"Slope"
strengthNumber1
thresholdNumber0
invertBooleanfalse
depth_weightNumber1
normal_weightNumber1
id_weightNumber1
spatial_strengthField

Gotchas

Threshold affects Magnitude mode only. It is ignored everywhere else, including the default Slope output.

The Camera and Source controls appear only once a 3D scene is wired in. With an image input they stay hidden and Slope reads the image directly.

Invert flips black and white in every output mode, not only Magnitude, so it gives light edges on a dark background or the reverse.

Worked example

  1. Add a Slope node and wire an image into it. Leave Method on Sobel and Output on Slope for the default packed result.

  2. Switch Output to Magnitude to isolate edge strength, then raise Threshold to drop faint, noisy edges.

  3. Turn on Invert for light edges on a dark background.

  4. To trace edges on a 3D scene instead, wire a Geometry input in and pick a Source such as Normal or Object ID for a clean silhouette pass.

See also

Emboss · Normal Map · Sharpen · Rasters (images)