Skip to content
Jellykit

Edge Detection

Find the outlines in a picture with a Sobel filter and save them as a black and white line image, with a threshold for cleaner lines.

  • Runs on your device
  • Works in the background
Loading tool

About Edge Detection

Every place where brightness changes sharply becomes a line: the edge of a building against the sky, the outline of a face, the lettering on a sign. Flat areas turn black and a full black-to-white step comes out pure white, with softer edges in grey between.

Raise the threshold to keep only the stronger edges as clean white lines, and switch on dark lines on white for something closer to a pencil outline or a colouring-page sketch.

How it works

  1. Your picture is decoded by the browser, upright, at its full size, and its pixels are read from a canvas.
  2. The chosen effect is computed pixel by pixel on that data. Pictures over one megapixel are handed to a background worker so the page stays responsive; moving a slider again stops the old run.
  3. Blur is three box blurs in a row, a close approximation of a Gaussian that takes the same time at any radius. Edges and emboss use the Sobel gradient of brightness.
  4. The result is drawn back to the canvas and saved in the format you click. Transparency is kept in PNG and WebP.

Questions

Which edge detector is this?

The Sobel operator, applied to the picture’s brightness (Rec. 709 weights). Its 3 × 3 kernels give the horizontal and vertical change, and the line strength is their combined magnitude.

Is this the Canny method?

No. Canny adds smoothing, thinning to one-pixel lines and two thresholds. Here you get the plain Sobel magnitude with a single optional threshold, so lines can be a few pixels wide.

My photo gives a noisy result. What helps?

Raise the threshold so weak edges drop out, or blur the photo slightly first with the blur effect, save it, and run edge detection on that.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.