Create Stencil from Image

Create stencils - threshold, posterize, edge-detect, or adaptive threshold. Custom colors, invert. PNG/WebP/JPEG. Free, client-side.

Turn any image into a stencil with 4 algorithms: simple threshold, posterize (multi-tone), Sobel edge-detect, or adaptive (block-mean) threshold. Custom ink/paper colors, invert option. Threshold slider, 5 luminance formulas.

Original / Stencil

Original Original
Stencil Stencil
Drop an image to begin.

How to Use Create Stencil from Image

  1. Drop an image. High-contrast subjects (portraits with good lighting, logos, line art) work best.
  2. Pick a style. Threshold = simple cutoff (best for cutting masks). Posterize = 2-6 gray levels (multi-layer painting). Edge-detect = Sobel outlines only (line-art stencil). Adaptive = local block-mean threshold (handles uneven lighting).
  3. Adjust style-specific sliders. Threshold/edge: 0-255 cutoff. Posterize: number of tones. Adaptive: block size + offset (positive offset darkens output).
  4. Pick ink and paper colors. Default black-on-white. Invert checkbox swaps them.
  5. Pick output format. PNG = lossless (best for stencils). WebP smaller. JPEG bad for sharp 1-bit edges due to DCT ringing.
  6. Stats line shows ink percentage. <0.5% or >99.5% triggers a warning toast - likely wrong threshold/style for this image.

Frequently Asked Questions

What are bridges and islands, and why do stencils need them?

An island is an enclosed shape that would physically fall out of a cut stencil, think of the inner circle of the letter O. A bridge is a small strip of material left in place to hold that island. When you cut a stencil from this tool’s output, scan it for closed shapes first: letters like O, A, R, and D always need bridges, and fine details may need thickening so the material does not tear. Edge-detect mode tends to produce fewer islands than threshold mode.

What’s the difference between a stencil and a silhouette?

A silhouette is a single solid shape – the outer outline filled with one color. A stencil preserves internal detail as separate cutout regions: a portrait stencil has separate areas for eyes, nose, hair, etc. That’s why stencils work for spray-painting (paint passes through the cutouts to make the image).

Which style for cutting on a vinyl cutter?

Threshold mode with PNG output. The output is strictly 2-color (ink + paper); the cutter interprets ink as cut, paper as keep (or vice versa). For physical cutting, remember to add bridges manually in your vector editor – this tool doesn’t add them (single-pixel-thin connections will fall out during cutting).

Which style for multi-layer spray painting?

Posterize with 3-5 tones. Each tone becomes a separate stencil layer (cut each level as a separate cut). For 3 tones: layer 1 is the darkest fill, layer 2 mid-gray fills only where mid-gray AND darker, layer 3 light fill only where light AND darker. You’ll likely want to separate them manually in Photoshop / GIMP after.

How does edge-detect work?

Sobel operator: for each pixel, compute horizontal and vertical gradient (per [[-1,0,1],[-2,0,2],[-1,0,1]] and its transpose), then magnitude = √(gx² + gy²). Edges with magnitude above threshold become ink; smooth regions become paper. Edge-thin stencils look like line drawings.

How does adaptive threshold work?

Compute the local mean luminance in a block-size × block-size window around each pixel (using an integral-image trick for O(1) per-pixel cost). If the pixel is darker than (local mean − offset), it’s ink. This handles uneven lighting much better than global threshold – a face that’s bright on one side and dark on the other doesn’t lose detail.

What does the “offset” slider in adaptive mode do?

Positive offset darkens the threshold: pixels need to be even darker than the local mean to qualify as ink. This reduces noise in areas where the mean is close to the pixel value (e.g., smooth gradients). Typical values 5-15.

What’s the “ink percentage” stat?

How many pixels became the ink color (vs paper). Very low (<0.5%) means threshold is too low and barely anything becomes ink. Very high (>99.5%) means threshold too high and almost everything is ink. The toast warns in both cases.

Why does JPEG output look fuzzy on stencils?

JPEG uses DCT compression which introduces “ringing” artifacts at sharp 1-bit edges. PNG is lossless and preserves the binary pixels exactly. For stencils, always PNG. WebP-lossless is also fine.

Is anything uploaded?

No. Canvas API runs in the browser. Your image never leaves your device.