X PixMap
X PixMap (XPM) is an image file format used by the X Window System, created in 1989 by Daniel Dardailler and Colas Nahaboo working at Bull Research Center at Sophia Antipolis, France, and later enhanced by Arnaud Le Hors.[src] It is intended primarily for creating icon pixmaps, and supports transparent pixels.[src] Derived from the earlier XBM syntax, it is a plain text file in the XPM2 format or of a C programming language syntax, which can be included in a C program file.[src]
X PixMap (XPM) is an image file format used by the X Window System, created in 1989 by Daniel Dardailler and Colas Nahaboo working at Bull Research Center at Sophia Antipolis, France, and later enhanced by Arnaud Le Hors.[src] It is intended primarily for creating icon pixmaps, and supports transparent pixels.[src] Derived from the earlier XBM syntax, it is a plain text file in the XPM2 format or of a C programming language syntax, which can be included in a C program file.[src] define XFACE_format 1 define XFACE_width 48 define XFACE_height 48 define XFACE_ncolors 2 define XFACE_chars_per_pixel 1 static char *XFACE_colors[] = { "a", "#ffffff", "b", "#000000" }; static char *XFACE_pixels[] = { "abaabaababaaabaabababaabaabaababaabaaababaabaaab", // and so on for 48 rows with 48 pixels With more colors the codes use more characters, e.g.[src] aa up to pp for 16 × 16 = 256 colors.[src] This is less useful for text editors, because a string ab could be actually the middle of two adjacent pixels dabc.[src] Spaces are allowed as color code, but might be a bad idea depending on the used text editor.[src] Without control codes, backslash, and quote (needed in XPM1 and XPM3) 128 − 33 − 2 = 93 ASCII characters are available for single character color codes.[src] Simplified example: 90 US-ASCII characters could be arranged into nine non-overlapping sets of 10 characters.[src] Thus unambiguous strings of nine characters could set the color of each pixel by its XPM palette index with up to 10 9 = colors (compare to GIF, which supports only 256).[src] For XPM2 it is clear how many lines belong to the image – two header lines, the second header line announcing the number of color codes (2 lines in the example above) and rows (height 4 in the example above), e.g.[src] 2 + 2 + 4 = 8 lines.[src] /* XPM */ static char * XFACE[] = { "48 4 2 1", "a c #ffffff", "b c #000000", "abaabaababaaabaabababaabaabaababaabaaababaabaaab", "abaabaababaaabaabababaabaabaababaabaaababaabaaab", "abaabaababaaabaabababaabaabaababaabaaababaabaaab", "abaabaababaaabaabababaabaabaababaabaaababaabaaab" }; If the "values" line contains six instead of four numbers, the additional values indicate the coordinates of a "hotspot", where 0 0 is the upper left corner of a box containing the icon and the default.[src] A "hotspot" is used for mouse pointers and similar applications.[src] define test_width 16 define test_height 7 static char test_bits[] = { 0x13, 0x00, 0x15, 0x00, 0x93, 0xcd, 0x55, 0xa5, 0x93, 0xc5, 0x00, 0x80, 0x00, 0x60 }; XPM2 version: ![src] XPM2 16 7 2 1 c #000000 .[src] c #ffffff ..*...........[src] .*.*...........[src] ..*..**.**..** .*.*.*.*.*..*.* ..*..**.*...** ...............* .............**.[src] XPM3 version: /* XPM */ static char * blarg_xpm[] = { "16 7 2 1", "* c #000000", ".[src] c #ffffff", "**..*...........", "*.*.*...........", "**..*..**.**..**", "*.*.*.*.*.*..*.*", "**..*..**.*...**", "...............*", ".............**." }; PBM file: P1 16 7 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 ==Application support== ACDSee, Amaya, CorelDRAW, GIMP, ImageMagick, IrfanView (formats plugin), PaintShop Pro, PMView, Photoshop (plugins), and XnView among others support XPM.[src] Gravatar also supports XPM.[src] An X11 libXpm vulnerability was fixed in 2005, and three more in 2023.[src] FFmpeg version 3.3 or later can decode XPM.[src] ==References== PBM (mono), PGM (grayscale), PPM (color), PNM (any) X BitMap[src]
28 sentences · 28 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"X PixMap." encyclopegia.org, 2025, https://encyclopegia.org/wiki/x-pixmap. Accessed 02 December 2026.
Chicago
"X PixMap." encyclopegia.org. Accessed December 2, 2026. https://encyclopegia.org/wiki/x-pixmap.
APA
encyclopegia.org. (2025). X PixMap. Retrieved December 2, 2026, from https://encyclopegia.org/wiki/x-pixmap
Accessed December 2, 2026 · CC BY-SA 4.0 · citation page · JSON