Threshold
Threshold reduces an image to two colours by cutting every pixel at a brightness level: anything at or below the cut-off becomes ink, everything above becomes paper. Three methods set that cut-off — a fixed level you choose, Otsu's method, which reads the level off each file's own brightness histogram, and adaptive, which gives every pixel its own level taken from the block of pixels around it. Ink and paper are both yours to pick, and the result is written as PNG, GIF, WebP or JPEG without a byte ever leaving the tab.
How it works
- Add your images Drag one file or a whole batch onto the page, or click browse. Each file is decoded in the tab and its brightness histogram is drawn under the preview.
- Pick a method Otsu is selected by default and reads the cut-off off each file. Choose Fixed to set one level yourself, or Adaptive for a photographed page whose lighting changes across the frame.
- Set the level, or the block and constant Fixed gives you a level from 0 to 255. Adaptive replaces it with a block size — the odd-numbered neighbourhood each pixel is judged against, from 3 to 255 pixels — and a constant saying how far below its neighbours a pixel has to fall to count as ink.
- Choose ink and paper The two swatches are the only colours in the finished image; they start black on white. Swap ink and paper turns the result into a negative without moving the cut-off.
- Apply and download Choose PNG, GIF, WebP or JPEG, press Apply, then download the single file or the whole batch as a ZIP.
Questions
- What does the Otsu setting actually do?
- Otsu's method reads the cut-off off the image's own 256-bin brightness histogram, picking the level that separates the dark pixels from the light pixels most cleanly. Because it is read per file rather than set once, a batch of ten images comes out at ten different levels — which is usually what you want, and occasionally not.
- Why does the preview differ slightly from the downloaded file?
- The preview is drawn at no more than 1000 pixels on its long edge, with the adaptive block scaled to match, while the export runs at full resolution. Fixed and Otsu match closely; adaptive can shift a little, because a block of the same pixel count covers a different amount of the real picture.
- Which format should a black and white image be saved as?
- PNG or GIF. A two-colour image compresses to almost nothing losslessly, and both formats write each pixel back exactly as it was set. JPEG and WebP re-compress the two colours into grey along every edge, which undoes the point of thresholding.
Every tool