Turn a GIF into OLED frames
A GIF is already an animation - frames, delays, and all. This converter splits it into OLED frames, scales each one to your screen, turns it into 1-bit pixels, and writes an Arduino sketch that plays it 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.
Worked example: the converter's built-in 8-frame, 64x64 radar animation is 8 x 512 = 4,096 bytes as bitmaps and 2,626 bytes as rectangles and lines (Adafruit library, extra drawing code included). Compiled for an Arduino Uno, the whole sketch went from 17,428 to 15,972 bytes. A 30-frame full-screen animation would need 30,720 bytes of bitmaps, which is more than an Uno has left after the display library. The number and size of frames set the limit, not the GIF's file size.
How to convert a GIF to an OLED animation in 4 steps
- 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, so
frame_2comes beforeframe_10. - Pick your board and display. The size is shrunk to fit the screen automatically while preserving aspect ratio.
- Tune the animation: adjust the brightness cut-off, dithering for photos, invert for dark drawings, and fine-tune playback speed.
- Check the flash size in the memory panel, then copy or download the ready-to-run
.inosketch.
How many frames fit? OLED Flash budget table
Every full-screen 128x64 frame is 1,024 bytes as a bitmap, and a 64x64 frame is 512 bytes. This is how many bitmap frames fit in one animation. The Uno numbers come from compiling the converter's sketches with the Arduino AVR compiler; the others follow from the board's flash and the limits below.
| Microcontroller | Flash for your sketch | Full-screen 128x64 frames (bitmap) | 64x64 frames (bitmap) |
|---|---|---|---|
| Arduino Uno / Nano | 32 KB | 18 with Adafruit, 23 with U8g2 (compiled) | 36 with Adafruit (compiled) |
| Arduino Nano Every | 48 KB | up to 31* | up to 63* |
| Arduino Mega 2560 | 256 KB | up to 31* | up to 63* |
| ESP8266 (NodeMCU / D1) | about 1 MB | 200 (converter limit) | 200 (converter limit) |
| ESP32 (WROOM / S3 / C3) | 1.25 MB (default app space) | 200 (converter limit) | 200 (converter limit) |
| Raspberry Pi Pico (RP2040) | 2 MB | 200 (converter limit) | 200 (converter limit) |
* AVR boards cannot hold one array larger than 32,767 bytes, and the converter keeps an animation in one array, so 31 full frames is the most per animation even on boards with more flash. The converter reads up to 200 frames from a GIF. Vector code often fits more frames: the radar sample above needs about 330 bytes per frame instead of 512.
Tips for great OLED animations
- Use high-contrast line art: Clean outlines and bold solid shapes look sharpest on monochrome OLEDs. Solid shapes shrink the most in vector mode; dithered photos do not shrink at all.
- Keep the I2C bus at 400 kHz: a full 1,024-byte frame takes about 100 ms to send at 100 kHz (about 10 FPS at most) but about 25-30 ms at 400 kHz. The Adafruit SSD1306 / SH110X libraries and U8g2 already switch to 400 kHz on their own, so you do not need to add
Wire.setClock(). If you need more speed, animate a smaller area. - Animate only the part that moves: if only the centre of the screen changes, make the animation 64x64 (half the bytes of a full screen) or 32x32 (one eighth), and draw the still parts once.
Vector code for animations
Vector mode turns each frame into rectangles, lines or run-length rows and checks every frame pixel-for-pixel. Each frame is stored on its own (there is no frame-to-frame compression). For the radar sample it saved 36% with Adafruit and 29% with U8g2; for detailed or dithered frames Auto keeps the bitmap. See the measured results in our vector code flash guide.
Supported OLED displays and microcontrollers
Supports SSD1306, SH1106, SH1107, and SSD1327 displays with Adafruit GFX and U8g2 on Arduino Uno, Nano, ESP32, ESP8266, STM32, and RP2040. Full hardware specifications and wiring details are on our homepage.
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. In our compile tests an Uno fits 18 full frames with the Adafruit library and 23 with U8g2. Smaller images or vector code let you fit more; ESP32 and ESP8266 boards fit the converter's 200-frame limit easily.
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. A display can only go so fast: sending a full 128x64 frame over I2C at 400 kHz takes about 25-30 ms, so full-screen animations top out at roughly 30-40 FPS.
Can I convert a colour GIF?
Yes. Colours become 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.
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
- Adafruit GFX vs U8g2: Which OLED Library Should You Use?
More OLED converters
- OLED Bitmap Converter - Full conversion tool for static images, logos, and vector code
- 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