DoG Studio

Configurable sketch-ification of images and videos, all in your browser.

DoG Studio implements a family of Difference-of-Gaussians image binarization techniques from computer graphics research, as a free, GPU-accelerated tool that runs entirely in your browser.

XDoG

Fast edge detection, pure line output.

FDoG

Flow-aligned edges that stay coherent and clean instead of fragmenting in noisy or textured regions.

ADoG

Adaptive tone/shading, generating screentone-style dot density that automatically gets denser in dark areas.

HDoG

Combines FDoG lines and ADoG tone into a single result that resembles hand-drawn pen-and-ink illustration.

No server ever sees your image. No signup. No watermark. No limit on how many times you run it.

I originally built this to help myself learn to draw, and kept extending it as I found more uses for it.

Most "photo to sketch" tools give you one fixed look. DoG Studio exposes the actual parameters researchers use to control the effect (e.g. Gaussian scale, contrast sensitivity, edge coherence, tone density) so you can dial in exactly the style you want instead of accepting a single preset.

You can also stack layers with blend modes. HDoG itself is really just an FDoG layer and an ADoG layer combined. DoG Studio generalizes that idea so you can nest as many layers as you want: an FDoG pass for structure, an ADoG pass for midtones, a second ADoG pass at a larger scale just to fill in the darkest shadows, all blended together and tuned independently.

And because it's GPU-accelerated and parametric rather than a black-box neural filter, changes preview in real time and produce the same result every time you run them.

Printable / cuttable / engravable line art

FDoG and HDoG output is clean, binary black-and-white, which is exactly what a laser engraver, wood burner, vinyl cutter, or CNC router wants. Tune the Gaussian scale to match your tool's line width, and you're ready to cut.

Coloring book pages

Run FDoG alone (lines, no shading) to turn any photo into a clean outline ready to color in (ex. kids' books, adult coloring pages, or line-art templates for tracing).

Manga and comic screentone

ADoG produces a dot-density pattern that behaves like traditional manga screentone, automatically getting denser in shadows. Use it as a shading layer under your own inked linework.

Stipple and pointillism-style art

ADoG's tone-adaptive dot placement mimics stippling. Rotationally symmetric Gaussian kernels keep dot spacing regular even in busy, noisy image regions, so the result reads as intentional rather than random noise.

Tattoo stencils, and reference art

HDoG's clean separation of line and shading makes a solid starting stencil from a reference photo, without the fuzziness of a generic sketch filter.

Portraits and pen-and-ink illustration

HDoG is designed to mimic professional pen-and-ink illustration. It combines coherent contour lines with adaptive shading in one pass.

Several of the outputs are more useful as a starting layer for drawing/illustrating than as a finished image:

  • Sketch/underpainting guide. Run FDoG on a reference photo for a clean, coherent contour map (not the fragmented noise you get from raw edge detection on textured photos), then paint or trace over it as a loose armature instead of eyeballing proportions.
  • Value/shadow mapping ADoG's tone-adaptive dot density works as a free posterized shadow map, showing where dark masses fall before you start rendering.
  • Layered underlays Export an FDoG line layer and an ADoG tone layer separately, and bring each into Procreate, Photoshop, or Clip Studio as its own reference layer.
  • Procedural, reproducible passes The effect is parametric rather than a diffusion or neural filter, you get consistent results across a whole batch. This is useful for game asset pipelines, animation frames, or any workflow that needs the same style applied repeatedly and predictably.

If you work with Stable Diffusion, ComfyUI, or Automatic1111, DoG Studio's line and tone maps work as conditioning input the same way Canny, HED, or Lineart preprocessors do, but with edge-tangent-flow smoothing that keeps lines coherent instead of the fragmented, noisy edges you get from raw Canny on a textured photo.

  • Export an FDoG pass as a Lineart/Scribble-style ControlNet input for structure-preserving img2img
  • Export ADoG separately as a soft tone/shading conditioning map
  • Feed both into a multi-ControlNet stack for tighter control than a single preprocessor gives you
  • Tune parameters (σ, ρ, φ) and lock them for consistent conditioning across a whole batch. This is useful for character sheets or frame-by-frame consistency
  • No local Python, ComfyUI install, or GPU setup required. you can generate the conditioning map in your browser and drop it straight into whatever pipeline you're already running, local or hosted

Most of the time I'm using DoG Studio to get a "good enough" sketchified base, then exporting it into SketchBook Pro on my tablet to actually finish the piece: emphasize the parts I want, delete texture or detail I don't, and add color by hand from there.

I lean on blending a lot more than nesting. My usual move is running several DoG instances at different sigma values in the same stack, one tuned for high-level shapes, one for mid-sized features, one for fine detail, then blending them together instead of trying to get one configuration to do everything at once. Nested layers come up occasionally when I need to combine two already-blended stacks, but it's the exception rather than the rule.

If I can't get a look I want inside the app, I'll export each layer separately instead of blending them here, and use masks in SketchBook to pull the specific details or components I want from each one.

FAQs

No, this is not AI. There's no model and no training data. XDoG-family filters are a well-established edge-detection technique. Edges produce a strong signal because the two blurs diverge there; flat regions produce almost nothing because they stay close together. FDoG, ADoG, and HDoG are modern refinements published as recently as the 2021, adding flow-aligned smoothing, tone sensitivity, screentone, and layered combination to fix the exact weaknesses plain edge detection has. Everything still runs deterministically in your browser so the same input with the samep parameters always produces the same output.

XDoG finds edges by subtracting two Gaussian blurs and thresholding the result. It's fast, but only renders lines. FDoG does the same thing, but first computes an "edge tangent flow" (the dominant direction of nearby edges) and blurs along that flow instead of uniformly, so lines stay smooth and connected instead of fragmenting in textured/noisy areas. ADoG uses the same Gaussian-subtraction idea but makes its sensitivity to contrast vary with local brightness, so it produces denser dot-like clusters in dark areas and sparser ones in light areas. ADoG extracts tone instead of lines. HDoG runs FDoG and ADoG separately and keeps a pixel only if both mark it as ink, combining clean structure with shading in one image.

Faces benefit from FDoG or HDoG. The flow-aligned blur keeps contours (jawlines, eyes) coherent instead of noisy. Landscapes with lots of fine texture (foliage, water) often look better with ADoG or HDoG, since XDoG/FDoG alone can't represent the tonal gradients of sky or shadow.

FDoG specifically exists to fix this: by smoothing along the estimated edge direction rather than isotropically, it suppresses the "fluctuating positive/negative response" that appears in noisy image regions, which is what causes ragged lines in plain XDoG.

Yes, that's essentially what HDoG is under the hood: an FDoG pass for lines, an ADoG pass for tone, combined pixel-by-pixel. The ability to add layers and blending function lets you build the same kind of composite manually (e.g., stack an FDoG layer over an ADoG layer with a Multiply/Darken blend).

Larger primitives naturally need more spacing between them, which caps how dark a region can look purely from size. HDoG's answer is a second ADoG pass at a larger scale, run only to fill in the darkest areas without disturbing lighter ones. That second pass's scale is controlled by adogSecondaryScaleFactor (default 4, meaning the secondary pass uses 4x the primary pass's s value). If shadows still look too sparse, try increasing it.

The threshold is a smooth tanh curve, not a hard cutoff, so at low phi values, changes to epsilon shift the transition gradually rather than producing a visible line.

Not required, but it often improves results. DoG-based filters are sensitive to noise, and cleaning that up before the DoG pass tends to give cleaner lines/tone than trying to compensate with sigma/phi alone. This is a general property of DoG-style edge detection.

They differ in how much smoothing they apply and which filters they use. Light runs a single mild bilateral pass, good for already-clean studio shots or illustrations. Standard runs one moderately stronger bilateral pass for typical outdoor photos and portraits. Heavy and Nature both run two bilateral passes back to back for aggressive noise removal, but Nature uses a stronger first pass tuned for grass, foliage, and other fine natural texture, while Heavy is a bit more moderate and general-purpose. Artistic is the odd one out: it runs a Kuwahara filter (which gives a painterly, stylized look) followed by a light bilateral pass, rather than two bilateral passes.

Yes, when you change the preprocessing pipeline, the preview image will switch to the preprocessed image.

Layers let you run several DoG passes on the same image and combine them (the same idea as HDoG's own FDoG-AND-ADoG combination), just generalized so you aren't limited to one fixed recipe. Each layer can hold one or more DoG configs plus a blend mode describing how it merges with the layer below it.

Stack an FDoG layer (for structure) over an ADoG layer (for tone) using a blend mode that keeps dark pixels from either layer. This mirrors exactly what HDoG's logical AND is doing mathematically, just exposed as two separate, independently-tunable layers instead of one fixed combination.

A DoG node is a single XDoG/FDoG/ADoG/HDoG config, the smallest building block. A layer is a container that groups multiple nodes (configs or other layers) under a name and blend mode. Since layers can hold other layers, you can nest arbitrarily, for example a layer blending two sub-layers, each blending two configs.

Blend mode applies per-layer so if you want to combine A and B one way, then blend that combined result with C a different way, you need A+B in their own layer, blended into C at the outer level. Flat lists can't express that; nesting can.

FDoG needs an extra flow-field computation (the edge tangent flow) before it can even start filtering, which is the main added cost over XDoG. HDoG is the most expensive of the four because it runs a full FDoG pass and two ADoG passes (the second one just for shadow detail) and then combines them.

The underlying algorithm is linear-time and GPU-parallelizable. Published benchmarks report 1000+ fps at HD resolution on a several-years-old mid-range GPU. I am still learning WebGPU-optimization though, so it likely still needs improvements for that