Binarize a scan for clean printing

Grey washout, shadows at the spine, uneven lighting — thresholding turns a photo of a page into true black on white.

Tools used in this guide

The job

A photographed page is a mess of grays. Global thresholding picks one cutoff; Otsu picks it for you; adaptive thresholding compares each pixel to its neighborhood, which survives shadows a single cutoff can't.

Three methods

Fixed: slide the threshold manually. Otsu: the tool finds the split that maximizes the gap between dark and light — the usual default for even pages. Adaptive: local-mean comparison over a configurable window, for pages with lighting gradients.

Worked example

A phone photo of a receipt under lamplight: global 128 clips the shadowed corner to black blobs. Otsu lands near 140 and keeps most text. Adaptive with a 31 px window keeps the corner text too, at the cost of a slightly rougher texture.

Scope

PNG/JPG/WebP up to 25 MiB and 40 MP; output is a two-level PNG. It binarizes, but does not deskew, denoise, or OCR — feed a straight page for clean results.