Play an animated GIF on an OLED display
Upload an animated GIF and this converter splits it into frames, scales them to your OLED screen, converts them to 1-bit pixels and writes an Arduino sketch that plays the animation at the GIF's own speed. It handles transparent GIFs and GIFs that only update part of the picture each frame, so the result matches what you see in your browser.
How to convert a GIF to an OLED animation
- Upload your GIF with the Upload button, or drop it anywhere on the page. You can also select several PNG frames at once; they are sorted by name (frame_2 before frame_10).
- Pick your board and display. The size is shrunk to fit the screen automatically.
- Tune the look with the brightness cut-off, dithering for photos, and invert for dark drawings on a light background.
- Check the flash size in the memory panel, then copy or download the sketch.
Tips for great OLED animations
- Use high-contrast, simple drawings. Thin outlines and flat shapes look best on 1-bit screens and compress best as vector code.
- Keep animations short and small. Every full-screen 128x64 frame is 1,024 bytes as a bitmap.
- An Arduino Uno has 32 KB of flash, and the display library already uses about 8 to 13 KB, so long animations are better on an ESP32 or ESP8266.
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
How do I play a GIF on an OLED display with Arduino?
Upload the GIF here. The converter reads every frame and its delay, converts the frames to OLED bitmaps or drawing code, and writes a sketch whose loop() shows the next frame every FRAME_MS milliseconds using millis().
How many animation frames fit on an Arduino Uno?
Each full-screen 128x64 frame needs 1,024 bytes as a bitmap. After the display library, an Uno has roughly 20 KB left, so about 20 full frames. Smaller images, fewer frames or vector code let you fit more; ESP32 and ESP8266 boards have room for hundreds.
Why is my OLED animation too fast or too slow?
The speed is taken from the GIF file. Change it with the Speed slider; the FRAME_MS value in the generated code updates to match. The real speed also depends on how fast your display updates.
Can I convert a colour GIF?
Yes. Colours are turned into black and white using a brightness cut-off, with optional Floyd-Steinberg or Bayer dithering for photos. Tick Invert if the drawing is dark on a light background, because an OLED lights the bright parts.
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.