Arduino TFT LCD GUI – Load Bitmap Image

Posted by:


There are two ways to draw bitmap images in Arduino TFT LCD – to draw from SD card, or convert them into byte array. The first is more powerful and works with true color bitmap images; the 2nd approach is more suitable for simple logo and monochrome images, and there is no need for SD capability for this method.

Convert Images to C++ Byte Array

There are a few options to convert image into byte array.


This is a handy Java GUI utility to convert a BMP file into the array code necessary to display the image with the drawBitmap function. Check out the code at ehubin’s GitHub repository: Note that this is a java-based program and you might need to install java from if you haven’t already done so. Another tool, did not try. One more for windows?

  1. Download the utility from above link
  2. Run the java utility

  3. Click choose file to convert, copy the code, and paste it into Arduino sketch.


NB: DrawBitmap in Arduino Sketch

  1. Add following (otherwise it will display garbage) in front of the array:

    and draw with following code:

  2. screenshots with Adafruit and Arch Linux logos


drawXBitmap function with GIMP exported Array

You can use the GIMP photo editor to save a .xbm file and use the array saved in the file to draw a bitmap with the drawXBitmap function. See the pull request here for more details:


  1. Export from GIMP to *.xbm, rename *.xbm to *.c and open in editor.
  2. C Array can be directly used with this function
  3. Arduino Sketch

    and draw with following code:

  Related Posts

Add a Comment