XPM

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(add link to libXpm gitlab, update current release tarball name, change "The XPM story" link to archived page since original is now gone)
m (Sample files)
 
Line 51: Line 51:
 
* http://www.fileformat.info/format/xpm/sample/index.htm
 
* http://www.fileformat.info/format/xpm/sample/index.htm
 
* http://stuff.mit.edu/afs/athena/contrib/graphics/images/icons/
 
* http://stuff.mit.edu/afs/athena/contrib/graphics/images/icons/
* https://telparia.com/fileFormatSamples/image/xpm/
+
* {{DexvertSamples|image/xpm}}
 
* https://www.qemu.org/ - [https://download.qemu.org/qemu-7.0.0-rc4.tar.xz qemu-7.0.0-rc4.tar.xz] → logo.xpm
 
* https://www.qemu.org/ - [https://download.qemu.org/qemu-7.0.0-rc4.tar.xz qemu-7.0.0-rc4.tar.xz] → logo.xpm
 
* http://ftp.mozilla.org/pub/thunderbird/ - [http://ftp.mozilla.org/pub/thunderbird/releases/60.5.3/source/thunderbird-60.5.3.source.tar.xz thunderbird-60.5.3.source.tar.xz] → mozicon16.xpm mozicon50.xpm
 
* http://ftp.mozilla.org/pub/thunderbird/ - [http://ftp.mozilla.org/pub/thunderbird/releases/60.5.3/source/thunderbird-60.5.3.source.tar.xz thunderbird-60.5.3.source.tar.xz] → mozicon16.xpm mozicon50.xpm

Latest revision as of 04:21, 28 December 2023

File Format
Name XPM
Ontology
Extension(s) .xpm, .pm, .c, .h
MIME Type(s) image/x-xpixmap
PRONOM x-fmt/208
Wikidata ID Q1887604
Released 1989

X PixMap (XPM) is an uncompressed raster image file format. It is essentially the color version of XBM.

An XPM file is plain text. But some like the mentioned example dframeIB.xpm contain special characters like zero-byte or Control-Z at the end. These then no longer represent pure ASCII text, which leads to malfunction of some programs. Except for the little-used XPM version 2, it doubles as a fragment of C program code. Therefore, instead of the usual extension xpm for the file name, you can also find the suffix h as in the example progressui_gtk_icon.h or the suffix c as in the example xpmputty.c. In some cases these also contain other C expressions. Unfortunately, this leads to some confusion. On some systems, such examples are now considered as C header text or C source text based on the file extension. When trying to edit them, they are usually opened with a text editor like Emacs or vi. On other systems, however, the examples are viewed as X pixmap files based on the magic comment. When trying to edit them, they are then usually opened with an image editor.

Contents

[edit] Identification

X PixMap should start with 9 byte c-comment /* XPM */. All start with a c-comment, but in some non-standard examples the magic comment appears several hundred bytes later, as in the examples mozicon16.xpm or mozicon50.xpm. Or this comment is even completely missing as in the example logo.xpm. Most programs cannot handle these variants, but some software like ImageMagick or IrfanView can. Therefore, one should also check the part defined as C program code. This begins with the two consecutive words static char, which are separated by white space. This can be combinations of spaces and tabulation characters, but usually one space is used. This string is often found a few thousand bytes after the beginning as in the example mh-logo.xpm. The character array is defined without explicit length specification. This can be recognized by the 2 byte sequence of square brackets [].

[edit] Specifications

[edit] Software

[edit] Sample files

[edit] External links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox