Image to Monochrome Bitmap C Array

Convert an image into a 1-bit monochrome C array for SSD1306 and similar OLED displays, with a choice of byte layout and adjustable threshold.

Monochrome bitmap converter

Your image is processed entirely in your browser using the Canvas API. It is never uploaded to a server.

Input

Choose an image to begin.
Choose an image to generate a monochrome bitmap array.

Preview

Original

Monochrome

Pixels-
Array size-
Byte layout-

Generated C code

Horizontal vs vertical byte layout

Horizontal layout packs 8 pixels per row into each byte, most-significant-bit first, matching the format Adafruit_GFX::drawBitmap() expects. Vertical layout packs 8 vertical pixels per byte within page-aligned rows, least-significant-bit first, matching the raw GDDRAM memory layout used by SSD1306 and similar controllers when writing pages directly. Pick the layout that matches your display library.

Choosing a threshold

Pixels darker than the threshold become on (or off, if inverted) and everything else becomes the opposite state. High-contrast source art with clean edges converts best; photos and gradients often need a threshold adjusted by eye using the live preview, since no dithering is applied.

Common monochrome OLED sizes

Typical SSD1306 modules are 128x64 or 128x32 pixels. Other common monochrome controllers include SH1106 (mostly 128x64, one extra GDDRAM column) and PCD8544 (Nokia 5110, 84x48), which use a similar page-based memory layout.

FAQ

What is the difference between horizontal and vertical byte layout?

Horizontal layout packs 8 horizontal pixels per byte, matching Adafruit_GFX::drawBitmap(). Vertical layout packs 8 vertical pixels per byte within 8-row pages, matching the raw SSD1306 GDDRAM format used when writing display pages directly.

Which layout does the Adafruit SSD1306 library need?

If you draw the bitmap with Adafruit_GFX::drawBitmap(), use horizontal layout. If you write bytes directly to display RAM through low-level page/column addressing, use vertical layout.

Why does my converted image look inverted?

Some displays treat a set bit as an off pixel depending on wiring or driver initialization. Use the invert option to flip the output without re-editing the source image.

Does this tool apply dithering?

No, this converter uses a simple brightness threshold rather than dithering. High-contrast line art and icons convert cleanly; for photos, try adjusting the threshold and cropping to the area you need.

Is my image uploaded anywhere?

No. The image is decoded and converted entirely in your browser using the Canvas API and never leaves your device.

Related tools