Image Threshold
Convert an image to two-tone black and white, with a threshold and explicit alpha controls.
This tool processes its input contents in your browser instead of sending them to a processing service. Page, asset and fixed usage-measurement requests are described on the Privacy page.
Creates a two-tone black-and-white PNG with an explicit brightness threshold, optional inversion, and chosen transparency behavior.
How to use it
- 1Choose one JPEG or still PNG for an automatic local preview.
- 2Keep the default threshold or adjust it while comparing the original.
- 3Optionally change brightness rule, inversion or alpha handling; download the PNG and settings JSON.
Example
- Input
- Opaque gray 127 and gray 128; weighted RGB, threshold 128, no inversion.
- Output
- Gray127 becomes black (0,0,0); gray 128 becomes white (255,255,255).
Equality, endpoint thresholds, inversion, alpha compositing and linear-light behavior are covered by the focused pixel checks.
What happens to your data
Image pixels and threshold settings stay in this tab without upload or browser storage. Only fixed workflow action/outcome counts may be measured; the PNG is saved after your download action.
Last updated November 2026
Convert a local photo, scan or logo into two-tone black and white with an adjustable threshold. Upload once for an automatic preview and download a full-dimension PNG. The default uses weighted RGB brightness and composites any transparency onto white, producing an opaque black-and-white image.
Optional controls let you invert the two colors, choose linear-light sRGB luminance instead of weighted encoded RGB, or preserve the source alpha. This is image binarization, not OCR, document cleanup by AI or a guarantee that faint detail will survive.
How it works
The default brightness is 0.2126R+0.7152G+0.0722B on browser-decoded 8-bit sRGB values. A brightness at or above the selected integer threshold becomes white; lower values become black. Invert swaps that assignment. Thus opaque gray 128 is white at threshold 128, while gray 127 is black. Every output RGB channel is either 0 or 255. This threshold effect is different from grayscale, which can retain many gray values.
The linear-light option first divides each channel by 255 and applies the sRGB transfer curve: c/12.92 when c≤0.04045, otherwise((c+0.055)/1.055)^2.4. It applies the same weights and scales luminance by 255 before comparing. A mid-gray sRGB value is not half of maximum linear light, so changing the rule can change the result substantially.
Opaque white or black modes composite source alpha onto that chosen background before thresholding, in the selected brightness space. Keep original alpha instead thresholds the decoded colors and retains each alpha byte; partially transparent black or white can then look gray against another background. The checkerboard is not exported. Settings JSON records the rule, threshold, inversion, transparency mode, dimensions and output counts without image pixels or the original filename.
JPEG and still PNG inputs are limited to 20 MiB,16 million pixels and 8,192 pixels per side, with checks before and after decoding. Animated PNG, 16-bit PNG, SVG and other formats are refused. PNG export keeps the decoded dimensions but re-encodes pixels without copying source metadata. Preview scaling and browser color conversion mean this is not a byte-preserving or print-calibrated workflow. Cancel, replacement and edits invalidate stale output; generated URLs are cleaned up. No image or threshold setting is uploaded or written to browser storage by this tool.
Worked example: Split two adjacent gray values at an explicit boundary
- Input
- Opaque gray 127 and gray 128; weighted RGB, threshold 128, no inversion.
- Result
- Gray127 becomes black (0,0,0); gray 128 becomes white (255,255,255).
Equality, endpoint thresholds, inversion, alpha compositing and linear-light behavior are covered by the focused pixel checks.
Common use cases
- Creating a high-contrast two-tone logo draft
- Exploring a threshold for a scanned diagram before OCR elsewhere
- Preparing simple stencil-style artwork
- Comparing encoded RGB and linear-light brightness rules
Frequently asked questions
How is threshold different from grayscale?+
Grayscale retains intermediate brightness levels. Threshold assigns each pixel RGB to exactly black or white. Preserved partial alpha can still make those colors look gray when composited for display.
What happens exactly at the threshold?+
Brightness equal to the threshold becomes white before optional inversion. A tiny numerical guard prevents floating-point noise from turning mathematical equality into a different color.
Why does linear-light mode look different?+
sRGB stores gamma-encoded channel values. Linear-light mode decodes that curve before calculating luminance. A channel value of128 is therefore much darker than half maximum linear light.
Why did a transparent region turn white?+
The default explicitly composites transparency onto white. Choose black for a black matte, or Keep original alpha to retain the decoded transparency.
Will this recover faded writing or read my text?+
No. A threshold can discard detail as well as increase contrast. Compare the original and result, retain your source and use a separate OCR tool if you need editable text.
Is the source image uploaded?+
No image or setting is uploaded or stored by this tool. Fixed workflow measurement can report an action, outcome and bounded counts without the image, filename, threshold or other settings.
Related tools
Make Color Transparent
Remove white or a picked color from images, preserving other alpha values in a PNG.
Crop Image
Trim a photo to the part you want, freehand or locked to a ratio like 1:1 or 16:9.
Image Trim
Trim transparent or solid-colour image borders with explicit thresholds and PNG export.
Remove Image Background
Cut the background out of a photo and download a transparent PNG, with the model running on your device.