Simple Bitmap Converter

Hi!

I created a small application for Windows to convert bitmap images into C Arrays.

It’s very simple. Just select a folder and the app will convert all images that are inside (png, jpg and tga) in the file bitmaps.h

The array format is compatible with drawBitmap()

The output text is like this:emphasized text
(comment text is image file name and image size)

//--------------------------------------
//    ENEMY1 16x16
//--------------------------------------
const unsigned char PROGMEM enemy2a_bitmap[] =
{32, 64, 152, 172, 172, 152, 160, 192, 160, 152, 172, 172, 152, 64, 32, 0, 
0, 0, 4, 6, 10, 1, 3, 2, 3, 1, 10, 6, 4, 0, 0, 0, 
};

//--------------------------------------
//    ENEMY2 16x16
//--------------------------------------
const unsigned char PROGMEM enemy2b_bitmap[] =
{0, 0, 48, 104, 104, 48, 64, 128, 64, 48, 104, 104, 48, 0, 0, 0, 
0, 12, 2, 9, 21, 35, 7, 5, 7, 35, 21, 9, 2, 12, 0, 0, 
};

//--------------------------------------
//    PLAYER 10x8
//--------------------------------------
const unsigned char PROGMEM player_bitmap[] =
{224, 176, 248, 124, 39, 39, 124, 248, 176, 224};



https://drive.google.com/open?id=0BxUh6DPh9TMxVUxsY2lVTlhRVWM

I hope you find it useful.

Best regards

2 Likes

Nice. How does it name the images?

Hi,
The name of the images can be anything you want. All images must be in the selected folder.

The name of the array is the imagename + _bitmap