If you work with TFT, eink, or LCD displays along with microprocessors like Arduino, at some point you will need to convert an image into a byte array to use it.
This has the additional difficulty factor that displays on microprocessors use different color models than the usual RGB888 (24 bits, 16 million colors), such as RG565 (16 bits, 65 thousand colors), RG332 (8 bits, 256 colors), or grayscale with a different number of bits.
There are many programs to perform the conversion, but personally, my favorite is Lcd Image Converter. This program is simple to use while incorporating all the functionalities we normally need.
LCD Image Converter allows you to create an empty image or, more frequently, import an existing image for conversion. The available formats include the usual ones, such as JPG, BMP, GIF, TIFF, PNG, among others.

We can export the image to a C array via the File/Converter command. The result is a file containing the array along with a structure that adds the size and bit depth so we can use it directly in our program.
static const uint16_t image_data_myimage[76800] = {
//... data ....
};
const tImage myImage = { image_data_myimage, 320, 240, 16};
By default, the program includes preconfigured conversion profiles for color models like RGB565, RGB454, 8-bit and 4-bit grayscale, and monochrome.
However, it is possible to create any other conversion pattern using the wizard and the program’s configuration options.

As a tip, when exporting the image you will usually also want to modify the “Block Size” parameter, which corresponds to the grouping of bytes in the export result, to adapt it to the needs of your graphics library.
Lcd image converter is Open Source and the code is available in the repository on Github. The project page (http://www.riuson.com/lcd-image-converter) is down, but the repository is still active, and it is also possible to download it from Sourceforge.

