PDA

View Full Version : Graphics format


ccwaterback
09-26-2005, 03:20 PM
Does anyone know what kind of image conversion I need to do to transform a .bmp file into a structure like this?


static const char* const image0_data[] = {
"93 99 53 1",
"t c #f78229",
"z c #f78629",
"q c #f78631",
"n c #f78a31",
"Q c #f78a39",
"X c #f78e31",

(more definitions ... followed by ...)

"...",
"..#ab...caac.",
"..def...cgh#.",
".ijj#....gkl.",
".mno#....pqjb",
"rste#....pnqgu.........",
"uvtte#....dntwb.........",
"xytte#....pntzAc........",
"chztte#....pnttBx........",
"CDttte#....dnttte#.......",
"bjtttte#....dntttDC.......",
"pqtttte#....pnttttEb......",
"rjttttte#....pnttttngu.....",
"uFzttttte#....dntttttwG.....",

etc ...


You can see, what is happening is characters are being defined to html-type colors.

Does this format look familiar to anyone? Thanks.

Omphaloskeptic
09-26-2005, 03:32 PM
Does anyone know what kind of image conversion I need to do to transform a .bmp file into a structure like this?

static const char* const image0_data[] = ...

You can see, what is happening is characters are being defined to html-type colors.

Does this format look familiar to anyone? Thanks.This looks like XPM (X windows pixmap) format. Try ImageMagick (http://www.imagemagick.org/)'s "convert" program, for example.

ccwaterback
09-26-2005, 05:03 PM
This looks like XPM (X windows pixmap) format. Try ImageMagick (http://www.imagemagick.org/)'s "convert" program, for example.

Cool.

I found that the Linux gimp command does these conversions also.