What is XPM? X PixMap Format Explained
A color X Window System icon format storing pixmaps as C-compatible ASCII text.
Last updated:
What is XPM?
XPM (X PixMap) is an image format used by the X Window System, created in 1989 at the Bull Research Center in France by Daniel Dardailler and Colas Nahaboo, and later enhanced by Arnaud Le Hors. It was designed primarily for color icon pixmaps and supports transparent pixels.
An XPM file is plain text, either in the XPM2 form or as a C character-string array that can be included directly in a C program. The data is organized into sections for values (width, height, color count, characters per pixel), a color table mapping character codes to colors, the pixel rows, and optional extensions. Colors can be hex codes or X11 color names, and the keyword None marks transparency.
How XPM Works
An XPM file is plain text, written either in the XPM2 form or as a C character-string array that can be compiled directly into a program.[1] Its data is organized into a values line (width, height, color count, and characters per pixel), a color table mapping character codes to colors, the pixel rows, and optional extensions.[2]
History and Standardization
XPM was created in 1989 at the Bull Research Center in France by Daniel Dardailler and Colas Nahaboo, and later enhanced by Arnaud Le Hors, to provide color icon pixmaps for the X Window System.[1] Colors may be given as hexadecimal values or X11 color names, and the keyword None designates transparent pixels.[2]
Technical Limitations
Because each pixel is encoded as one or more printable characters, XPM files grow large for big or color-rich images and are inefficient compared with binary raster formats.[2] Its strengths, human readability and direct C inclusion, kept it popular for desktop icons rather than general image storage.[1]
MKV Technical Specifications
XPM vs Other Image Formats
| Feature | XPM | PNG | GIF |
|---|---|---|---|
| Type | Raster | Raster | Raster |
| Color depth | Palette, color[1] | Up to 16-bit | 8-bit palette |
| Encoding | C source code[1] | Binary | Binary |
| Transparency | Yes[2] | Yes | Yes (1-bit) |
| Compression | None[1] | Lossless | Lossless (LZW) |
| Best for | X11 color icons[1] | Web graphics | Simple animation |
XPM extends the X11 pixmap concept to color icons stored as C code, useful in toolkits but not for general or web image delivery.
Advantages & Disadvantages
Advantages
Unlike XBM, XPM stores color images and supports a transparent color via the None keyword, ideal for icons.
As a C character-string array, an XPM pixmap can be included and compiled directly into an application.
XPM accepts X11 color names as well as hex codes, and can declare color, grayscale and monochrome variants per pixel.
The plain-text structure can be viewed and edited in any text editor, which is handy for small icons.
Disadvantages
Storing pixels as ASCII character codes makes XPM bulky and unsuitable for photographs or large graphics.
XPM is primarily an X Window System icon format and is uncommon outside that and developer contexts.
While some editors support it, XPM has narrower support than mainstream formats like PNG.
Common Use Cases
XPM is mainly used for color icons and small graphics in X Window System software.
Application and toolbar icons | FileFormer
XPM was widely used to define color icons for X11 applications and desktop environments.
Compiled-in pixmaps | FileFormer
Developers embed XPM data directly in C source so icons ship inside the program binary.
Window manager graphics | FileFormer
X-based window managers and toolkits use XPM for small color UI elements that need transparency.
Convert XPM Files Free
Use our free online converter to convert XPM and other formats - no signup, no watermarks.
Try Image Converter FreeFrequently Asked Questions
What is the difference between XPM and XBM?
XPM supports color images and transparency, while XBM is limited to 1-bit monochrome bitmaps.
Does XPM support transparency?
Yes. XPM can designate a color as None, which is treated as transparent, making it well suited to icons.
Is XPM a C source file?
It can be. XPM exists as a C character-string array (includable in programs) or as the plain XPM2 text form.
What colors can XPM use?
XPM colors can be specified as hexadecimal values or as X11 color names, with separate color, grayscale and monochrome definitions allowed.
Who created XPM and when?
It was created in 1989 by Daniel Dardailler and Colas Nahaboo at the Bull Research Center, and later enhanced by Arnaud Le Hors.