PNG Threshold Filter — Pure Black & White Converter
Apply a brightness threshold to a PNG. Every pixel becomes either pure black or pure white, depending on whether its luminance is above or below the cutoff you choose. Useful for scanned text, line-art and high-contrast stylisation.
What thresholding does
A threshold filter — sometimes called "binarisation", "1-bit conversion" or simply "black-and-white" — converts every pixel in an image to one of exactly two values: pure black (0) or pure white (255). The decision is made by measuring each pixel's brightness (luminance) and comparing it against a single cutoff value. Above the cutoff = white. Below = black. There are no gray pixels in the output; the image becomes a stark, high-contrast two-tone graphic.
This is mathematically the simplest possible image conversion, but it's surprisingly useful. Scanned book pages, hand-drawn line art, technical drawings, signatures and logos all benefit from thresholding — it removes the gray "fog" that scanning introduces and produces clean, OCR-friendly, vector-traceable output.
When to use a threshold filter
- Cleaning up scanned documents. Scans are rarely pure black-on-white — the background is usually slightly gray, the ink slightly variable. Thresholding fixes that.
- Preparing images for OCR. Optical character recognition tools work much better on binary images than on full-tone scans.
- Vector tracing. Tools like Adobe Illustrator's Image Trace produce cleaner SVGs when the input is already binary.
- High-contrast art. Threshold-only photographs have a striking, graphic look used in print-making and screen-printing.
- Reducing file size. A binary PNG compresses dramatically smaller than a grayscale PNG — often 10× smaller.
- Inkjet/laser printing of line work. Eliminates the soft halftones that some printers produce on gray pixels.
- Creating masks. When you want a pure black/white mask from a partially-transparent or low-contrast source.
How to choose the threshold value
The threshold is on a scale of 0–255, matching the standard 8-bit brightness range. 128 is the midpoint — half-way between pure black and pure white. For most natural images, 128 is a good starting point but rarely the optimum:
- For dark scans / faded documents — try 160–200. A higher threshold keeps more of the faded ink as black.
- For bright/clean scans — try 100–130. A lower threshold drops more of the slight background gray.
- For photographs — usually 110–140 produces the most readable two-tone result.
- For art — pick whatever value gives the look you want; the "right" answer is aesthetic.
Luminance — how brightness is calculated
To make the threshold decision, the tool converts each colour pixel to a single brightness value using the same Rec. 709 luminance formula used by the PNG Grayscale tool: brightness = 0.2126 × R + 0.7152 × G + 0.0722 × B. This matches how human vision perceives brightness — green looks much brighter to us than red or blue at the same numeric value. The result is then compared against the threshold and the output pixel becomes pure black or pure white.
Invert option
By default, pixels brighter than the threshold become white and darker pixels become black. The Invert checkbox swaps that mapping — darker pixels become white, brighter pixels become black. This is the same effect as running the threshold filter then a colour invert. It's useful for stickers, T-shirt print artwork, and any case where you want the "subject" white and the background black.
Tips and best practice
- If your scan has uneven lighting (one side darker than the other), a global threshold won't work — half the image will look right, half wrong. Use a tool that supports adaptive (local) thresholding for those cases.
- For pencil drawings on cream paper, raise the threshold to 200 — the slightly-warm paper background still reads as "lighter than 200" to the luminance calc.
- If thresholding loses detail you wanted to keep (e.g. light pencil shading), the threshold may simply be too low to capture it. Bumping it up rescues some of that detail but may also let background noise through.
- For OCR prep, threshold then save as PNG (not JPG) — JPG re-introduces gray pixels from compression and breaks OCR accuracy.
- Combine threshold with the PNG Blur tool (small radius) before thresholding to smooth out noise that would otherwise create stray black/white speckles.
Threshold vs. grayscale — different operations
Grayscale converts each pixel to one of 256 shades of gray; threshold converts each pixel to one of two values (black or white). Grayscale preserves all the tonal variation, just without colour. Threshold throws that variation away in exchange for absolute simplicity. If you want a "black and white photo" look, use PNG Grayscale. If you want stark binary output for printing, OCR or stylisation, use threshold.
FAQs about PNG thresholding
Will transparency be preserved?
Yes — alpha channel is unmodified. Only RGB becomes binary.
Why does my output look grainy?
Photographic noise gets exaggerated at threshold boundaries. Try blurring slightly before thresholding to smooth it out.
What's the file-size saving?
Binary PNGs compress 5–20× smaller than full grayscale or colour PNGs of the same dimensions.
Can I get a tri-tone (black/gray/white) output?
Not from this single-threshold tool. Use a posterize tool for multi-tone reduction.
Is the operation reversible?
No — information is permanently discarded. Save your original before thresholding.
Is anything uploaded?
No. Threshold runs in your browser.