Image to MCU Array Converter

Original Image

Original image preview

Processed Preview

About Image to MCU Array Converter

This tool converts images into C/C++ arrays suitable for microcontroller projects. It supports both 8-bit grayscale and 1-bit black & white modes, making it perfect for various types of displays and memory-constrained applications.

Features

  • Two conversion modes:
    • 8-bit grayscale (1 pixel per byte)
    • 1-bit black & white (8 pixels per byte)
  • Customizable output dimensions
  • Adjustable threshold for B&W conversion
  • Live preview of processed image
  • Color inversion option
  • Memory-efficient output for MCUs

Usage Examples

// Arduino 8-bit Grayscale Example
const uint8_t image_gray[] PROGMEM = {
    // Each byte represents one pixel (0-255)
    0x00, 0x40, 0x80, 0xFF, // Example values
};

void setup() {
    display.begin();
    display.drawGrayscaleImage(0, 0, image_gray, 128, 64);
    display.display();
}
// Arduino 1-bit B&W Example
const uint8_t image_bw[] PROGMEM = {
    // Each bit represents one pixel (0=black, 1=white)
    // One byte contains 8 pixels
    0b10101010, 0b11001100, // Example values
};

void setup() {
    display.begin();
    display.drawBitmap(0, 0, image_bw, 128, 64, WHITE);
    display.display();
}