Source Image No image

Source image preview Upload an image to see it here.

Tuned Grayscale -

Selected Binary Variant No selection

About this tool

Image to Pixels: turn a photo or logo into an OLED bitmap

A photo has millions of colours; a monochrome OLED has two. Squeezing one into the other is a real image processing problem, and no single method wins for every picture. This converter therefore tries dozens of methods at once - simple thresholds, adaptive thresholds and dithering - scores each result, and shows you the best ones side by side so you can pick with your own eyes.

Your image is processed inside your browser and is not uploaded. Open the sections below to see how to use it and what each method actually does.

How to convert an image, step by stepSize, preset, tuning, variants, export
  1. Open your image. Drop it on the upload area or click to choose one. PNG, JPG, WEBP and the other formats your browser can open all work.
  2. Set the output size. Enter the width and height of your display - 128 × 64 for the common SSD1306. Choose how the image fits: Contain keeps the whole picture and adds bars, Cover fills the screen and crops the edges, Stretch fills it and distorts.
  3. Pick a preset. Photo, Logo, Document or Mixed sets sensible starting values for the tuning controls.
  4. Tune if needed. Adjust brightness, contrast and gamma; the grey preview updates as you go.
  5. Generate the variant bank. The converter builds every variant, removes duplicates, scores them, and shows the top results.
  6. Choose and export. Click the result that looks best, then export it as a PNG or CSV, or send it to the Pixel Editor to touch it up and export C code.
The tuning controls, explainedBrightness, contrast, gamma, CLAHE, median and unsharp mask

Before any black-and-white decision, the image is turned into shades of grey and cleaned up:

ControlWhat it doesReach for it when
BrightnessAdds or removes the same amount of light everywhereThe whole picture is too dark or too light
ContrastPushes greys away from the middle, towards black or whiteThe subject is washed out and hard to separate from the background
GammaBrightens or darkens the mid-greys while keeping pure black and white fixedFaces or shadows lose detail but the highlights are fine
CLAHEEvens out contrast region by region instead of across the whole imageOne part of the photo is in shadow and another in bright light
Median kernelReplaces each pixel with the middle value of its neighbours, removing specklesA noisy or low-light photo produces scattered dots
Unsharp maskExaggerates edges by subtracting a blurred copyOutlines come out soft or broken

CLAHE stands for contrast-limited adaptive histogram equalisation. The image is split into tiles, each tile's contrast is stretched on its own, and the clip value limits how far, so flat areas do not turn into noise.

Thresholds: the simplest way to make black and whiteFixed, Otsu, adaptive mean, adaptive Gaussian and Sauvola

A threshold compares every grey pixel with a cut-off value: brighter becomes on, darker becomes off. Grey values run from 0 (black) to 255 (white). The converter tries several ways of choosing that cut-off:

  • Fixed. One cut-off for the whole image. The converter tries 80, 96, 112, 128, 144, 160 and 176. It works well for clean logos and line art.
  • Otsu's method. Looks at how many pixels have each grey value and picks the cut-off that best separates them into two groups - the one with the largest difference between the groups. It is automatic and good for images with a clear subject and background.
  • Adaptive mean and adaptive Gaussian. Each pixel gets its own cut-off: the average of the pixels around it (plain or weighted towards the centre), minus a small constant. Uneven lighting stops being a problem, which makes these good for photographed documents.
  • Sauvola. Also local, but it also looks at how much the neighbourhood varies. In a flat region the cut-off drops below the local average, so a smooth background comes out as one clean colour instead of noise, while text keeps its strokes.

Each of these can also be cleaned with a morphological open (removes isolated specks) or close (fills small gaps), and those versions are scored too.

Dithering: faking grey with patterns of dotsFloyd-Steinberg, Atkinson and Bayer ordered dithering

A threshold throws away every shade of grey. Dithering keeps the impression of grey by varying how many pixels are lit in an area, just as a newspaper prints photos with dots. It suits photos and gradients; it does not suit small text, which it makes fuzzy.

Error diffusion: Floyd-Steinberg and Atkinson

The image is processed pixel by pixel. Each pixel is set to black or white, and the difference between the grey it wanted and what it got - the error - is passed on to neighbours not yet processed.

  • Floyd-Steinberg passes 7/16 of the error to the pixel on the right, 3/16 below left, 5/16 directly below and 1/16 below right. All of the error is passed on, so average brightness is preserved well. Best for photographs.
  • Atkinson passes 1/8 to each of six neighbours - only three quarters of the error. The quarter it drops makes highlights and shadows cleaner and more contrasty, a look many prefer on small screens.

Ordered dithering: Bayer 2×2, 4×4 and 8×8

Instead of spreading error, each pixel is compared with a value from a small repeating grid of thresholds, the Bayer matrix. A 2×2 grid gives 4 levels of grey, 4×4 gives 16, and 8×8 gives 64. The result is a regular cross-hatch texture. Because each pixel's decision depends only on its own grey value and position, a small change in the picture changes only a few pixels - so ordered dithering tends to flicker less than error diffusion in animations.

How the converter ranks the resultsThe four scores behind "best variant"

Every variant gets a score between 0 and 1, built from four measurements:

MeasureWeightWhat it rewards
Coverage0.34A share of lit pixels close to the Target Coverage slider
Edges0.32Outlines that line up with the edges in the grey image
Speckle0.18Few tiny isolated blobs of pixels
Continuity0.16Shapes of a sensible size, rather than dust or one huge block

The weights add up to 1. The score is a guide, not a verdict: it cannot know that you care more about a face than the background. Look at the top few and trust your eyes, and if everything looks too dark or too light, move the Target Coverage slider and generate again.

Which method suits which pictureA quick guide
Your pictureTry first
Logo or icon with flat coloursFixed threshold or Otsu, then tidy in the editor
Photo of a person or sceneFloyd-Steinberg or Atkinson
Photographed page or sign with textAdaptive Gaussian or Sauvola
Frames for an animationBayer 4×4 or a threshold, to avoid flicker

Crop tightly before converting. At 128 × 64 there is no room for background, so the subject should fill the frame.