ToolJovia
Images

Scan Image Binarizer

Create an actual black-and-white scan PNG using an explicit global Otsu or clipped local-mean threshold model.

✓ Browser-local processing

Loading tool…

How to use Scan Image Binarizer

Create an actual black-and-white scan PNG using an explicit global Otsu or clipped local-mean threshold model. Choose a global histogram split or a local threshold for varying scan illumination, then inspect the real pixel artifact. The output keeps full source dimensions and does not claim OCR, automatic document cleanup or recovery of unreadable details.

  1. Provide static scan image, local square radius, used in local mean mode, local mean subtraction in code levels.
  2. Choose the supported mode and run the tool. Review its assumptions and any reported errors.
  3. Copy the result or download a separate output; reset to clear the current form.

Good to know

  • One static non-animated PNG, baseline JPEG or simple VP8/VP8L WebP, at most 8 MiB, 1,000,000 pixels and 2,048 per side. Strict structure/CRC and dimension preflight precedes native decoding; APNG, progressive JPEG, extended/animated WebP, compressed PNG metadata, SVG/GIF and header/native orientation disagreements are refused.
  • Decoded alpha is flattened over white. Rounded encoded RGB gray uses weights 2126 R + 7152 G + 722 B over 10,000 after compositing; this is not linear-light luminance or raw scanner colorimetry. Every output pixel is opaque black or white at unchanged dimensions.
  • Otsu examines all nonempty two-class 256-bin splits and maximizes exact between-class variance by BigInt cross-multiplication. Equal scores choose the lowest threshold. A one-bin histogram uses threshold 0 and is flagged as degenerate. Black means gray less than or equal to the threshold.
  • Local mean uses an integer radius 1–63 and offset 0–100, validated in either mode. Its square clips to existing image pixels; no border replication or outside zero samples are added. Black means gray × area is at most sum minus offset × area. An integral-image sum avoids repeated neighborhood scanning and no intermediate mean is rounded.
  • This selected border, gray and tie model is not OpenCV bit parity. It does not apply Gaussian weighting, blur, deskew, dewarp, text recognition, semantic foreground detection or a guarantee that thresholding improves a scan. Keep the original and inspect thin text and shaded areas.
  • The local model uses at most one 8-byte integral table cell per source-prefix position, one gray byte and one four-byte output pixel per source pixel, plus bounded source/transfer arrays. Pixel work is linear in the one-million-pixel input, with 256 histogram candidates.
  • Native decode waits at most 10 seconds and PNG encoding at most 5 seconds; codec work cannot be forcibly aborted. Bitmap/canvas resources are released on success/failure and late decoded results are closed. Encoded PNG is at most 8 MiB. Native color conversion, premultiplication or re-encoding can change source/hidden transparent bytes or metadata; this is not an archival sample-preservation promise.
  • The local pixel module prepares within 10 seconds before ready; a separate 2-second computation deadline applies. Processing uses bounded pixel arrays, not external image services, arbitrary code, mounted user HTML/SVG or uploaded files.
  • Structured text output is limited to 500,000 characters. Reduce the supplied source when that separate output budget is exceeded.
  • Inputs are processed on this device and are not automatically saved or uploaded.

Common questions

Which method should I choose for a scan with shadows?

Local mean compares each pixel with a bounded nearby neighborhood, which can help when illumination varies. Otsu uses one global histogram split. Neither method understands text or restores lost detail, so compare the actual PNG and adjust the declared local controls if needed.

Does this change my original input?

No. The tool returns a separate result. Review that output before using it in another application.

Keep going with related tools

All images →