Image threshold — turn a picture into pure black and white

Choose an image and a cut-off from 0 to 255; every pixel at least that bright becomes white, and every darker pixel becomes black, with no greys left.

Live demo · real result from this tool

Drop images here

or paste with Ctrl+V · nothing is uploaded

Your result appears here — processed on your device.

Processed on your device — nothing is uploaded.

How to use Image Threshold

  1. Choose one or more images.
  2. Set Threshold (luma) from 0 to 255. The default is 128, the middle.
  3. Keep Save as on PNG (the default) for crisp edges and a small file, or pick another format.
  4. Press Apply and download the result.

What it does and when to use it

Thresholding (also called binarising) splits a picture into two tones. It is useful for:

  • Scanned signatures and stamps for forms, where the paper must be pure white.
  • Pencil or ink sketches you want to clean up before colouring or tracing.
  • Stencils, rubber stamps and laser engraving, which need two-level art.
  • Text photos where a uniform white page reads better, though a text extractor works better for copying words.

A lower threshold keeps more white; a higher threshold keeps more black. If you want soft shading kept, use Image Grayscale instead. For a few tones instead of two, use Image Posterize. A two-tone result also traces neatly with Image to SVG.

How it works

For each pixel the tool works out its brightness (luma) with the Rec. 709 weights that CSS greyscale also uses:

luma = 0.2126 × R + 0.7152 × G + 0.0722 × B

If luma is greater than or equal to the threshold, the pixel becomes white (255, 255, 255). Otherwise it becomes black (0, 0, 0). Transparency is kept as it was. There is no dithering and no smoothing, so edges follow the original pixels. The work runs in a background worker on your device, and no file is uploaded.

Worked examples

These values come from the tool’s own formula.

  • An orange-brown pixel (200, 100, 50). Its luma is 117.65. At the default 128 it turns black; at a threshold of 110 it turns white.
  • Faint pencil on cream paper. Paper at (240, 240, 240) has luma 240, and a light grey stroke at (220, 220, 220) has luma 220. At threshold 170 both turn white, so the stroke vanishes. Pick a value just above the stroke’s luma, such as 225, to keep strokes black and paper white.
  • Pure red (255, 0, 0). Luma 54.21, so it turns black at any threshold above 54.

Limits and tips

  • Uneven lighting, such as a shadow across a phone photo of a page, makes one part too dark. Shoot in even light or crop the shadow out.
  • Very small text can break up. Scan at a higher resolution first.
  • JPEG output adds soft grey edges back around the shapes; keep PNG for clean two-tone files.

Frequently asked questions

How is this different from greyscale?
Greyscale keeps all 256 shades of grey. Threshold keeps only two, black and white. That is what you want for a signature, a stamp or a stencil, and not what you want for a black-and-white photo.
My signature has a grey background from the scan. Which threshold should I use?
Raise the threshold until the paper turns fully white but the pen lines stay solid. Paper that scans as light grey often needs a value somewhere between 150 and 200, depending on the scan, so try a few.
Can I make the white parts transparent?
Not in this tool. Run the result through Image Color Replace, or use the background remover for photos.
Why do red lines disappear or turn black?
The cut-off uses brightness, and pure red is quite dark (about 54 out of 255). It turns black at the default 128. Pale colours such as yellow are bright and turn white.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close