BMP to C image conversion utility

BMP to C image conversion utility

wellsk's picture
PreviewAttachmentSize
lpcbmp2c.zip40.68 KB
File info
File version: 
v1.01
NXP verified: 
YES

This image conversion utility will convert a BMP image into C code that can be statically compiled into a program for display on an LCD or graphics device. The tool generates a file from a BMP that looks similar to the following:

/*
* BMP image data converted from 24bpp
* to RGB565
* Red and green data swapped
*/

#define COLOR_BPP          16
#define COLOR_STORAGE_SIZE 2
#define BMPWIDTH           240;
#define BMPHEIGHT          320;

const unsigned short image16[] = {
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
...
...

The tool can also generate a raw data file that can be directly placed into a frame buffer as a data file.
Supported output formats are RGB888, RGB565, RGB555, and RGB444.

feedback