Gimp generates C arrays for OLED & LCD images

The attached Python script "" is a plugin for the GIMP ( which allows (small) grayscale images to be saved directly as a C header file containing an array of pixel data. Edit your grayscale image then select "Save As" and from GIMPs (long) list of formats pick "C Source code header", either 1 bit or 4 bit. Example output shown below, although it easily modified to suit your specific needs.

This forum won't allow .py files to be uploaded, so please remove the .txt extension I added to get around this.

This has been tested on Linux and Windows with the TI LM3S8962 EVK, see the Python source file for the install and use instructions.

Try out Inkscape, it's a nice vector graphics editor which can be used to make icons, export to GIMP, then to your OLED.




5 Replies