By Tim King · Updated
Edge Detection Online
Canny Edge Detector on a Photo, Outline Downloaded as a PNG
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Edge Detector works
This edge detection online tool traces outlines in a photo. Drop in a photo and this traces every edge it can find, giving you a clean black and white outline of the scene. Slide the two thresholds to decide how faint an edge still counts, add blur to suppress texture and noise, and download the result as a PNG. The image is processed entirely in your browser.
Edge detection online: getting a good result
Edge detection finds the places in a picture where brightness changes sharply: the border between a face and the background, the lines of a building, the rim of a cup. This tool uses the Canny algorithm, which is still the standard approach forty years after it was published. It first blurs the image slightly, then measures the brightness gradient at every pixel, thins the result down to one-pixel-wide ridges, and finally decides which ridges are real edges using two thresholds.
Low and high threshold work together in a step called hysteresis. Any pixel whose gradient is above the high threshold is definitely an edge. Pixels between the two thresholds are kept only if they connect to a definite edge, which is how the algorithm follows a faint contour that is attached to a strong one without also picking up isolated speckle. A good starting ratio is high at two to three times low. Lower both to pull in more detail; raise them to keep only the strongest outlines.
Blur before detecting sets the size of the Gaussian blur applied first. A small blur removes sensor noise and fine grain that would otherwise show up as thousands of tiny edges; a bigger blur also smooths away fabric weave, foliage and other texture so only the large shapes remain. Gradient chooses how the strength of an edge is measured: the fast L1 norm adds the horizontal and vertical changes, while the precise L2 norm takes the true magnitude, which gives slightly cleaner edges on diagonals at a small cost in speed. Output flips between white edges on black, the conventional way to view a detector's output, and black edges on white, which looks more like a line drawing and prints better.
Very large photos are scaled down to 2400 pixels on the long side before processing so the result appears quickly. The edge pixel count in the stats is a useful gauge: a few percent of the frame usually means a clean outline, while fifteen percent or more means texture is being picked up and the thresholds or blur should go up. The library that does the work is loaded on first use and the image never leaves your device.
FAQ
What thresholds should I start with?
Low around 50 and high around 150. Keep the high at two to three times the low; lower both for more detail, raise both to keep only the strongest outlines.
Why is the whole image covered in edges?
Texture is being detected. Increase the blur before detecting to smooth away grain, foliage and fabric, and raise both thresholds. The edge pixel count in the stats should fall to a few percent.
Can I get coloured edges?
No, the output is a one-bit black and white image. For a colour line-art look use the photo to sketch tool's ink outline, or tint the PNG in an editor.
Is this the same as a Photoshop "Find Edges" filter?
Similar goal, different method. Find Edges shows gradient strength as a grey image; Canny thins the edges to one pixel and uses hysteresis to keep only connected contours, which is why the result is a clean outline rather than a soft embossed look.
See also: all Images tools, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.
Related tools
Aspect Ratio Cropper
Crop to a standard ratio without shrinking the picture.
Palette Extractor
Pull the dominant colours out of a photo as hex codes.
Image To WebP
Convert to WebP, JPEG or PNG with a quality slider.
Symmetry Sketchpad
Mirror drawing pad with vertical, horizontal, four-way and kaleidoscope symmetry.
Cartoon Photo Filter
Turn a photo into a cartoon with flat colours and ink lines.