Skip to content

framecodev/image-to-header

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Image to Header File Converter for Arduino

The project provides a simple tool to convert images into C/C++ header files that can be used with Arduino. The generated header file contains the image data in a format suitable for rendering on displays such as OLED, TFT, or other graphical LCDs.

Features

  • Converts images (e.g., BMP, PNG, JPG) into a C/C++ header file.
  • Generates an array of pixel data for easy integration with Arduino projects.
  • A Graphic user interface was added for easy use.

Requirements

  • Python 3.x

Usage

  1. Install dependencies:
    Ensure you have Python 3.x or latest. Then, install the required library:

    pip install pyqt5
    pip install pillow

    or for a faster method just run the run.bat file instead

  2. Run:
    After running you can specify the option to customize the output:

    • Size: set the screen size of your project.
    • Output name: set the name for the header file or output.
    • Choose format: set the format colour to use (e.g., B&W, RGB565, RGB888).
  3. Include the header file in your project:
    copy the generated output.h file into your Arduino project directory and include it in your sketch:

    #include "output.h"
  4. Animated header:
    You need a split GIF for this purpose, use ezgif then split.
    now extract the folder, then use that folder you want to animate.
    use this method to animate your Arduino display project:

    void loop() {
      for (uint8_t i = 0; i < NUM_IMAGES; i++) {
        tft.display.pushImage(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, images[i]);
        delay(80); // adjust the speed
      }
    }

Important

There is still a missing or mismatch between the app and description details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published