BMP to XBM Converter

Convert a BMP into an XBM black-and-white bitmap.

or drop files here

BM

BMP Format

Windows Bitmap

A raster format from Microsoft that usually stores pixels uncompressed.

  • Mostly uncompressed
  • Color and grayscale
  • Windows and OS/2 origin
XB

XBM Format

X BitMap

A monochrome image stored as readable C source, historically used for icons and pointer artwork in the X graphical environment.

  • Black and white only
  • Plain-text C source
  • Optional hotspot

How to convert BMP to XBM

Follow these steps to convert BMP to XBM online.

    1

    Choose your BMP file, or several at once.

    2

    Wait while the converter turns each file into XBM.

    3

    Download each new XBM file. Your original file isn't changed.

What to know before converting BMP to XBM

  • XBM is monochrome, so colors and grays are reduced to black and white.
  • The page has no threshold control.
  • The output is C source text.
  • EXIF data, color profiles and XMP are dropped.

About BMP files

What is a BMP file?

Microsoft owns the BMP bitmap family, which began on Windows and OS/2. Each pixel is normally written out in full with no compression, and a lossless option exists. The 1998 version 5, which came in with Windows 98, adds room for an ICC profile and an alpha channel.

Most BMP files turn up among Windows screenshots and built-in system images. A BMP carries pixels only, so there are no vector shapes or live text to edit, and image/bmp is its registered media type.

Programs that open BMP files

  • Windows, Mac and Linux: Both ImageMagick and XnView MP handle BMP input, and XnView MP requires a license for company use.
  • Web: Firefox and Chrome both show BMP images, according to Mozilla's browser compatibility table.

BMP and XBM compared

  • Storage: XBM saves the image as readable C source, not a conventional binary picture.
  • Color: the picture is monochrome, black and white, so color artwork loses its colors on export.
  • Uses: it began as icon and pointer artwork for the X graphical environment.
  • Extras: an export may include hotspot coordinates, and an alpha channel can go to a separate mask file. The older X10 variant writes short integers instead of bytes.
  • Size: the C text can take more room than a binary encoding of the same image.

After the browser has decoded the BMP, ImageMagick in the same page turns the pixels into the XBM.

Other ways to convert BMP to XBM

  • ImageMagick: run magick mark.bmp -threshold 50% mark.xbm. The -threshold option sets pixels above the threshold to the maximum and the rest to the minimum, so the picture ends up black and white.
  • GIMP: start from the BMP, then File > Export As with .xbm as the name's ending. GIMP exports XBM only from an image with 8 bits per channel, and the dialog offers an identifier prefix, hot spot values, a comment and an extra mask file.
  • Pillow: open the BMP with Image.open, call convert("1") on it, then save it with a file name ending in .xbm. Pillow reads and writes X bitmap files in mode 1, and the default conversion to mode 1 dithers the picture.

Problems with BMP files

  • Bulk: an uncompressed BMP can take a lot of room, and PNG or JPEG may suit distribution better.
  • Header trouble: some older programs expect a different bitmap header, which ImageMagick's BMP3 and BMP2 formats provide.
  • No vectors: a BMP stores only pixels, so no converter can recover shapes or type from it.

Frequently Asked Questions

Everything you need to know about our converter

How do I convert BMP to XBM?

Why is my XBM only black and white?

What is the hotspot in an XBM?

Does the XBM keep transparency?

Will it keep my photo's detail?

Does my BMP's metadata survive?

What is the XBM file called?

Why does the page say the image failed to decode?