Convert an image to an OLED byte array in 4 steps
- Upload an image, a GIF, several images for an animation, or an
.ino/.hfile - or paste your byte arrays. - Choose your microcontroller, OLED display, and graphics library.
- Adjust brightness cut-off, dithering and invert until the live preview looks right.
- Copy or download the
.inofile and upload it with the Arduino IDE.
Worked example: a 64x64 logo is 512 bytes as a bitmap (64 / 8 x 64). In our tests a solid block logo dropped to 74 bytes as rectangles, but a thin ring-and-diamond outline only dropped to 482 bytes, and small icons stayed smaller as bitmaps. The converter shows you both numbers for your own image. See all measured results.
Why this instead of image2cpp?
Image2cpp is excellent for a single static bitmap, and this converter accepts its output directly. Where it goes further is the rest of the job: GIF animations with frame timing, a complete sketch with wiring and setup (not just an array), U8g2 XBM output, and vector code that is measurably smaller for icons and outlines. The full, measured comparison is in the image2cpp comparison guide.
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 frames. Most OLED graphics are outlines, icons and simple shapes, which take far less space as drawing commands - rectangles, lines, or run-length rows. Auto mode compares every method, 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. See our vector code flash guide for benchmark data.
Which displays, boards and libraries are supported?
Displays: 0.96in 128x64 SSD1306, 1.3in 128x64 SH1106, 0.91in 128x32 SSD1306, 1.5in 128x128 SH1107/SSD1327, 0.69in 96x16 SSD1306, 0.66in 64x48 SSD1306.
| Display | Driver Chip | Recommended Library |
|---|---|---|
| 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 |
Libraries: Adafruit SSD1306 / SH110X or U8g2. Boards: Arduino Uno, Nano, Mega 2560, Nano Every, ESP32 (S2, S3, C3), ESP8266 (NodeMCU, Wemos D1), STM32 Blue Pill, and Raspberry Pi Pico (RP2040). Sketches include I2C wiring and store images in flash (PROGMEM), so they do not use RAM.
Frequently asked questions
How do I display an image on an SSD1306 OLED with Arduino?
Convert the image to a byte array, store it in PROGMEM, and draw it with display.drawBitmap(x, y, array, width, height, SSD1306_WHITE), then call display.display(). This converter writes the whole sketch for you, including display setup at I2C address 0x3C.
Is this an image2cpp alternative?
Yes. Paste image2cpp output directly, or upload images and GIFs. It produces the same horizontal byte arrays for Adafruit drawBitmap, XBM arrays for U8g2, and optional vector code that is often much smaller - plus a complete sketch, not just an array.
How many bytes does a 128x64 OLED image use?
A 1-bit image uses width / 8 x height bytes: 1,024 bytes for 128x64 and 512 bytes for 128x32. Vector drawing code can be much smaller for outlines and simple shapes.
Why does my OLED image look scrambled or mirrored?
The bytes were read in the wrong format or at the wrong size. Adafruit drawBitmap uses horizontal rows, most-significant-bit first; U8g2 drawXBMP uses least-significant-bit first; some tools output vertical (page) bytes. Pick the matching format and size in the converter.
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.
OLED Guides & Tutorials
- OLED Troubleshooting Hub: Fix Scrambled, Mirrored, Shifted or Blank Displays
- How to Display an Image on an SSD1306 OLED with Arduino
- image2cpp Alternative, Compared Honestly
- Smaller Than a Bitmap: Vector Drawing Code Shrinks OLED Flash
- SH1106 vs SSD1306: Which OLED Do You Actually Have?
- Adafruit GFX vs U8g2: Which OLED Library Should You Use?
More OLED converters
- GIF to OLED Animation - Split animated GIFs into frames with millis() timing
- SSD1306 Bitmap Generator - Adafruit GFX drawBitmap code for 0.96" and 0.91" displays
- U8g2 Image Converter (XBM) - LSB-first XBM arrays and page-buffer constructors