# Graphics format

**URL:** <https://boards.straightdope.com/t/graphics-format/323553>\
**Category:** Factual Questions\
**Created:** [September 26, 2005, 8:20pm UTC](https://boards.straightdope.com/t/graphics-format/323553 "2005-09-26T20:20:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [September 26, 2005, 8:20pm UTC](https://boards.straightdope.com/t/graphics-format/323553/1 "2005-09-26T20:20:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [September 26, 2005, 8:32pm UTC](https://boards.straightdope.com/t/graphics-format/323553/2 "2005-09-26T20:32:55Z")

</div>

> [@ccwaterback](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [September 26, 2005, 10:03pm UTC](https://boards.straightdope.com/t/graphics-format/323553/3 "2005-09-26T22:03:53Z")

</div>

> [@Omphaloskeptic](#):
>
> 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.
