A Modern image2cpp Alternative
Convert an image to a C array, then see it on a simulated screen before you flash anything.
Runs in the browser. Free account, no install.
What Lopaka does
Lopaka is a graphics editor for embedded displays. It converts PNG, BMP, GIF, and video files into the byte arrays a display library expects, the same job image2cpp does, and then keeps going: the converted bitmap lands on a canvas that matches your display resolution, where you can position it, add text and shapes around it, and read the generated drawing code as you work.
The export covers U8g2, TFT_eSPI, AdafruitGFX, ArduinoGFX, ESPHome, GxEPD2, Flipper Zero, MicroPython, and CircuitPython. Monochrome targets get 1-bit XBMP bitmaps, colour TFTs get RGB565 arrays, and the dithering you pick is the dithering you see on the preview.
image2cpp compared with Lopaka
image2cpp is a good, free, single-purpose converter. This table is about where each tool fits.
| Capability | image2cpp | Lopaka |
|---|---|---|
| Converting a single image to a C array | Yes, and it is the fastest way to do it | Yes |
| Working without an account | Yes, always | Sign-in required |
| Preview on a simulated display | Preview of the converted bitmap | The whole screen, at the size your display reports |
| Placing the image in a layout | Not its purpose | Visual editor with layers, text, and shapes |
| Fonts | Not its purpose | Built-in fonts plus BDF, GFX, and TTF import |
| Output targets | Byte arrays for Arduino display libraries | Ready-to-compile source for 9 libraries |
| Animated GIF and video import | Not its purpose | Frame-by-frame import with generated playback code |
Converting an image
- Open the editor and pick the library and display size your board uses.
- Drop in a PNG, BMP, GIF, or video file.
- Choose how it is resized and dithered, and watch the result on the simulated screen.
- Copy the generated source from the code panel.
What the output looks like
A 16x16 bitmap placed at x 10, y 12, exported for U8g2 on Arduino.
static const unsigned char image_logo_bits[] U8X8_PROGMEM = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
void draw(void) {
u8g2.setFontMode(1);
u8g2.setBitmapMode(1);
// logo
u8g2.drawXBMP(10, 12, 16, 16, image_logo_bits);
}Questions
Is Lopaka a drop-in replacement for image2cpp?
For converting one image to a byte array, image2cpp does the job in a single step and there is no reason to switch. Lopaka is the better fit when the bitmap is part of a screen you are designing, when you need to see it on the display before flashing, or when you want the surrounding drawing code generated too.
Which display libraries does Lopaka export to?
Lopaka generates source for U8g2, TFT_eSPI, AdafruitGFX, ArduinoGFX, ESPHome, GxEPD2, Flipper Zero, MicroPython, CircuitPython.
Can I preview the image before exporting it?
Yes. The canvas is a simulated screen at your display resolution, so a 1-bit bitmap on a monochrome OLED looks the way it will on the hardware, dithering included.
Is it free?
Yes. Converting images and generating code for every supported library are part of the free Basic plan, along with the community font and icon libraries.
What image formats can I import?
PNG, BMP, GIF, and video files. Lopaka converts each one to the format the target platform needs, from 1-bit XBMP bitmaps for monochrome OLEDs to RGB565 arrays for colour TFTs.
Try it on your own image
Create a free account and the editor opens on a blank screen at your display size.