Utilora

Edge Detect — Sobel, Real-Time

Image Tools

What is Edge Detect — Sobel, Real-Time?

WebGPU Edge Detect runs a Sobel edge detector on your GPU directly in the browser tab. Edge detection is a foundational operation in computer vision and image analysis: it converts a photo or micrograph into a map of where intensity changes sharply — the outlines of objects, features, or text. It is a standard preprocessing step for figure preparation in scientific papers, line-art generation for illustration, and feature engineering for downstream ML models. Doing it on the GPU means the threshold and thickness sliders update in real time instead of after a multi-second wait.

How it works

The image is uploaded as a WebGPU texture. A WGSL fragment shader samples the 3×3 neighborhood around each pixel, computes the Sobel gradient magnitude, thresholds it, and writes the result back to a render target. The result texture is read back, drawn to a 2D canvas for preview, and encoded as PNG for download. The thickness slider scales the kernel sampling radius; invert flips the output so edges appear as dark ink on white.

Features & Benefits

  • Sobel kernel runs on the GPU via a WGSL fragment shader — interactive even on large images
  • Threshold and edge thickness adjust live without re-uploading
  • Optional invert mode produces clean black-ink-on-white line art
  • Works on any image the browser can decode; nothing is uploaded

Frequently Asked Questions

Why WebGPU and not Canvas?

Canvas-based edge detection works one pixel per JavaScript loop iteration. WebGPU runs all pixels in parallel on your GPU, so sliders are live instead of laggy on large images.

Which browsers work?

Chrome, Edge, and Firefox on Windows/Mac/Linux, plus Safari 26+. If WebGPU isn't available the tool shows a clear fallback message.

Does the image leave my device?

No. Decoding, GPU processing, and PNG encoding all run in your browser tab.

What kind of edge detector is this?

Classic 3×3 Sobel with magnitude thresholding. It is fast and predictable; for noise-robust edges consider a Canny-style pipeline, which we may add later.

Related Tools

Popular Utilities