PNG to Two Colors Converter

Computes each pixel's perceptual luminance and replaces it entirely with one of two colors you choose, based on a configurable brightness threshold, producing a bold duotone/poster effect rather than the many shades a grayscale or full-palette reduction would keep. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

A two-color threshold effect turns any photo into a bold, graphic duotone image — useful for posters, stencils, or a stylized visual treatment.

This tool computes it directly from pixel brightness, entirely in your browser.

What Is PNG to Two Colors Converter?

A pixel-level thresholding tool that replaces every pixel with one of exactly two colors, chosen by comparing that pixel's computed luminance against an adjustable threshold value.

It's the general-purpose version of the classic black-and-white threshold effect, with fully customizable replacement colors.

How PNG to Two Colors Converter Works

For every pixel, the tool computes perceptual luminance using the standard broadcast-weighted formula (green contributes most, blue least, matching human brightness perception), then compares that value against the threshold.

Pixels at or above the threshold are replaced entirely with the 'light' color; everything below becomes the 'dark' color, including that color's own alpha value.

When To Use PNG to Two Colors Converter

Use it to create a bold duotone poster effect, a stencil-ready silhouette, or a stylized two-tone version of a photo.

It's also useful as a quick visual threshold check — seeing exactly which pixels fall above or below a specific brightness cutoff.

Features

Advantages

  • Runs entirely client-side; the uploaded image never leaves your browser.
  • Fully customizable threshold and both replacement colors, not limited to black and white.
  • Produces a clean, flat two-color result useful directly for stencils or high-contrast graphic treatments.

Limitations

  • All original color and shading detail is lost — this is a destructive, one-way effect by design.
  • A single global threshold doesn't adapt to local contrast the way more advanced adaptive thresholding algorithms do, so unevenly lit images may not split cleanly along meaningful edges.

Examples

High-contrast portrait

Input

A photo with bright highlights and dark shadows, threshold 128

Output

A bold two-color duotone silhouette

Bright areas map to the light color, shadows to the dark color, at the default midpoint threshold.

Custom duotone

Input

A landscape photo with orange as the light color and navy as the dark color

Output

A stylized orange-and-navy poster-style image

Any two RGBA colors can replace the default black and white.

Best Practices & Notes

Best Practices

  • Start with the default threshold of 128 and adjust up or down based on how much of the image you want to fall into each color.
  • For a clean stencil-ready result, use fully opaque colors so there's no partial transparency to complicate cutting or printing.

Developer Notes

convertPngToTwoColors is a pure function over a PixelBuffer, reused directly by png-to-black-and-white-converter (which simply pins the two colors to pure black and white) rather than duplicating the threshold math.

PNG to Two Colors Converter Use Cases

  • Creating a bold duotone poster effect from a photo
  • Generating a stencil-ready high-contrast silhouette
  • Visualizing which pixels fall above or below a specific brightness threshold

Common Mistakes

  • Expecting any shading detail to survive — the effect is intentionally binary, with no intermediate tones.
  • Choosing a threshold far from the image's actual brightness distribution, resulting in an image that's almost entirely one color.

Tips

  • Preview at a few different threshold values before settling on one, since the right cutoff varies a lot by image.
  • Use high-contrast source photos for the cleanest results — evenly-lit or low-contrast images tend to threshold less predictably.

References

Frequently Asked Questions