X Pixmap
image/x-xpixmap
Released 1989
· by Daniel Dardailler and Colas Nahaboo (Bull / X Consortium)
The image/x-xpixmap MIME type represents the X Pixmap (XPM) format, a plain-text raster image format developed in 1989 by Daniel Dardailler and Colas Nahaboo at Bull, and later refined for the X Window System (X11). Building upon the concept of the 1-bit XBM (X Bitmap) format, XPM introduced full color support and transparency by formatting images as valid C programming language source code. An XPM file typically contains a color palette mapping single- or multi-character symbols to color codes (such as RGB hex values or 'None' for transparency), followed by an array of strings representing the 2D pixel grid. It was heavily used for icons, toolbar buttons, and UI themes in early Unix/Linux desktop environments.
Technical Specifications
.xpm
None
image/xpmimage/x-xpmapplication/x-xpixmap
Magic Bytes & HTTP Headers
/* XPM */
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Supported | Legacy |
Advantages & Limitations
- Can be compiled directly into C or C++ source code without requiring an external asset loading mechanism
- Human-readable palette mapping allows developers to inspect, modify, or hand-craft icons directly within a text editor
- Native support for color palettes and transparency via the 'None' keyword
- Extremely inefficient storage structure for large images, resulting in massive file bloat compared to binary formats like PNG
- Completely obsolete and unsupported in modern web browsers
- Parsing overhead requires compiling or interpreting text-based color tables at runtime
Developer Code Snippets
File Detection Steps
How to programmatically detect a image/x-xpixmap
file by reading its raw bytes:
- 1 XPM files are text files structured as C source code rather than binary files.
- 2 To reliably detect an XPM file programmatically, check if the file begins with the C comment block signature '/* XPM */' (Hex: 2F 2A 20 58 50 4D 20 2A 2F).
- 3 Following the comment header, a valid XPM file will contain a static `static char *...` array declaration defining the width, height, number of colors, and characters per pixel.
Software Support
ImageMagick
Conversion Tools
Share & Embed
[](https://freewebptojpg.com/mime/image/xpm)
<iframe src="https://freewebptojpg.com/mime/image/xpm/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="XPM Specs"></iframe>
JSON API
All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.
GET https://freewebptojpg.com/mime/image/xpm.json
Open JSON
Frequently Asked Questions
What is an XPM file?
An XPM (X Pixmap) file is a plain-text color image format created for the X Window System. Like XBM, it is written as valid C programming language source code, allowing developers to embed color icons and cursors directly into C/C++ applications.
Can I open an XPM file in a text editor?
Yes. Because XPM files are text files structured as C source code arrays, you can open them in any text editor to view the header dimensions, color symbol lookup table, and the character-grid representation of the image.
Does XPM support transparency?
Yes. One of XPM's major advancements over XBM was its ability to define a transparent color mapping using the keyword 'None' in the palette definition.