This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

XBM (.xbm)

MIME type: image/x-xbitmap
X Window bitmap format.
Used in the X11 windowing system for storing icons, cursors, and other graphics resources.
ASCII format.
Stores a monochrome bitmap as C language source code.
XBM is an acronym derived from X Bitmap.
Developed in the 1980s at MIT.
  • Export exports graphics or any other expression as an image to XBM.
  • Export creates an XBM image with the same image size as the displayed form of .
  • Because XBM is a raster image format, all fonts are rasterized on export.
  • Import imports the specified element from an XBM file.
  • Import imports multiple elements.
  • Export creates an XBM file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Data"array of color values
"Graphics"Graphics object representing an image
"GrayLevels"array of normalized gray-level values
"Image"raster image represented as an Image object
"RGBColorArray"array of RGBColor objects
"BitDepth"bits used to represent each color channel in the file
"ColorSpace"color encoding used in the file
"ImageSize"raster dimensions
  • General option:
ImageSizeAutomaticoverall image size
"DataType"Automaticdata type for storing pixel elements
This imports an XBM example file:
Import three metadata elements:
Importing as gives the entire original file as a string:
This imports an XBM example file:
In[1]:=
Click for copyable input
Out[1]=
Import three metadata elements:
In[2]:=
Click for copyable input
Out[2]=
Importing as gives the entire original file as a string:
In[3]:=
Click for copyable input
Out[3]=