Skip to converter

Image to C++ Array Converter

Arduino, ESP32 & OLED/LCD byte-array generator — upload or paste (Ctrl+V) an image, tune settings, generate code. Settings and results are saved in this page's URL, so you can bookmark or share an exact conversion.

Image & live preview

PNG · JPG · GIF · BMP · WebP · SVG
Drop images here, or click to choose
Paste with Ctrl+V · several files or a GIF become frames · nothing is uploaded
    Your converted image appears here on a simulated display — true pixel size, exactly what the code will draw.

    Your code

    Updates live as you change settings
    Size128×64
    Depth1-bit
    Flash—
    Imagesno image
    How to draw it
    // Load an image to see the code that draws it.

    Bytes → image

    Check or re-export an existing array

    Recent conversions

    Click to restore settings

    Which settings does my display library need?

    The same picture can be packed four different ways, and a library reading the wrong one shows mirrored blocks, stripes or noise. Pick your library in Output → Library and the converter sets all of this for you; the table is here so you know why.

    Library / callSettingsWhy
    Adafruit GFX drawBitmap() — SSD1306, SH1106, ST7735…Arduino, Horizontal 1-bitDefault. MSB = leftmost pixel, rows padded to whole bytes.
    U8g2 drawXBMP() / Adafruit drawXBitmap()Arduino, Horizontal 1-bit, LSB firstXBM bit order. Using MSB data here mirrors every 8-pixel block.
    SSD1306 / SH1106 frame buffer, Nokia 5110Arduino, Vertical 1-bit8-pixel pages, LSB = top pixel: memcpy_P() straight into the buffer.
    Adafruit drawRGBBitmap() — ST7735, ST7789, ILI9341Arduino, RGB565uint16_t per pixel, native byte order.
    TFT_eSPI pushImage()Arduino, RGB565Call tft.setSwapBytes(true), or tick “swap bytes” here instead.
    MicroPython framebufMicroPythonMONO_HLSB, MONO_HMSB, MONO_VLSB or RGB565 picked for you.
    Adafruit GFX custom font (setFont())Adafruit GFX fontEach image becomes one glyph; real GFXglyph / GFXfont structs.
    LVGL lv_image_dsc_tUse the LVGL converterRGB565, ARGB8888, indexed and alpha formats with the LVGL header.
    Logos and icons: Threshold or Atkinson dithering keeps edges clean. Nudge the threshold until thin lines survive.
    Photos on OLED: Floyd–Steinberg or Jarvis give the most grey levels. Raise contrast first — small panels flatten mid-tones.
    Animations: drop a GIF or a sprite sheet. Ordered (Bayer) dithering does not shimmer between frames the way error diffusion can.
    Upside-down or mirrored? Fix it in your sketch with setRotation(), or use Rotate / Flip here so the array is already right.
    Load an image to start
    Keyboard shortcuts
    CtrlVPaste an image
    CtrlOOpen images
    C / CtrlEnterCopy the code
    CtrlSDownload the .h file
    I R H VInvert, rotate 90°, flip horizontal / vertical
    1 2Display view / compare view
    + − 0Zoom in, out, fit
    G BPixel grid, byte boundaries
    Space ← →Play / step through frames