Make SSD1306 bitmaps for the Adafruit library
The SSD1306 is the chip inside the popular 0.96" 128x64 and 0.91" 128x32 OLED modules. The Adafruit SSD1306 library draws images with drawBitmap(), which expects a byte array in flash where each byte holds 8 horizontal pixels, left pixel in the highest bit. This generator creates exactly that format from any image, plus a complete sketch with the display set up at I2C address 0x3C.
Example: drawing the generated bitmap
display.clearDisplay();
display.drawBitmap(0, 0, logo, 128, 64, SSD1306_WHITE);
display.display();
Generate an SSD1306 bitmap in four steps
- Upload a PNG, JPG, BMP, WebP or GIF, or paste an existing array.
- Choose 0.96" 128x64 or 0.91" 128x32 SSD1306 and your board.
- Set the brightness cut-off and invert so the preview looks right.
- Copy the code. Pick "Keep as bitmap" for a classic drawBitmap array, or Auto for the smallest code.
Smaller than a bitmap: vector drawing code
A normal OLED bitmap stores every pixel: a full 128x64 screen is always 1,024 bytes, and an animation multiplies that by the number of frames. Most OLED graphics are outlines, icons and simple shapes, which take far less space as drawing commands. This converter can turn your bitmap into rectangles (fillRect / drawBox), rectangles plus 45° lines (drawLine) or run-length rows.
Auto mode compares every method with the plain bitmap, including the extra library code each one needs, and picks the smallest. Photos and dithered images usually stay as bitmaps. Every result is checked pixel-for-pixel against your original, so the screen shows exactly the same picture.
Supported OLED displays, boards and libraries
| Display | Driver chip | Library code |
|---|---|---|
| 0.96" 128x64 | SSD1306 | Adafruit SSD1306 or U8g2 |
| 1.3" 128x64 | SH1106 | Adafruit SH110X or U8g2 |
| 0.91" 128x32 | SSD1306 | Adafruit SSD1306 or U8g2 |
| 1.5" 128x128 | SH1107 / SSD1327 | Adafruit SH110X (SH1107) or U8g2 |
| 0.69" 96x16 | SSD1306 | Adafruit SSD1306 or U8g2 |
| 0.66" 64x48 (Wemos shield) | SSD1306 | U8g2 |
Boards: Arduino Uno, Nano, Mega 2560 and Nano Every, ESP32 (S2, S3, C3), ESP8266 (NodeMCU, Wemos D1), STM32 Blue Pill and Raspberry Pi Pico (RP2040). The generated sketch includes the I2C wiring for your board and stores images in flash (PROGMEM), so they don't use RAM.
Frequently asked questions
What bitmap format does Adafruit drawBitmap expect?
A 1-bit array stored in PROGMEM, read row by row. Each byte holds 8 horizontal pixels with the leftmost pixel in the most significant bit, and each row is padded to whole bytes: (width + 7) / 8 bytes per row.
What is the I2C address of an SSD1306 OLED?
Most modules use 0x3C. Some 128x64 boards are set to 0x3D. The generated code uses 0x3C and notes where to change it if the screen stays blank.
Why does my 1.3 inch OLED show garbage with the SSD1306 library?
Most 1.3" 128x64 modules use the SH1106 chip, not the SSD1306. Choose the 1.3" SH1106 display in the converter; the code then uses the Adafruit SH110X library, or U8g2.
Will a 128x64 image fit on an Arduino Uno?
Yes. The image is stored in flash (1,024 bytes for a full screen), but the Adafruit library also needs 1 KB of the Uno's 2 KB RAM for the screen buffer, so keep the rest of your sketch light or use U8g2 page mode.
Are my images uploaded to a server?
No. The converter runs entirely in your web browser. Your images, GIFs and code never leave your computer.