Share on Facebook Share on Twitter Email
Answers.com

X BitMap

 

A black-and-white bitmapped graphics format used in the Unix environment. It uses the .XBM extension and is often used as a hypertext icon on a Web page. Many Web browsers treat the white parts of the image as transparent, or background, which takes on the color of the underlying window.

Download Computer Desktop Encyclopedia to your iPhone/iTouch

Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
Wikipedia: X BitMap
Top
X BitMap
Blarg.xbm.png
A sample XBM file
Filename extension .xbm
Internet media type image/x-xbitmap unofficial
image/x-xbm unofficial
Type of format Image file formats
Extended to XPM

In computer graphics, the X Window System uses X BitMap (XBM), an ASCII text monochrome image format, for storing cursor and icon bitmaps used in the X GUI.

XBM files differ markedly from most image files in that they take the form of C source files. This means that they can be compiled directly into an application without any preprocessing steps, but it also makes them far larger than their raw pixel data would be (each byte of image data takes at least 5 bytes in a XBM file).

Format

XBM data typically appears in headers (.h files) and consist of a series of static unsigned char arrays containing the monochrome pixel data. They feature one array per image stored in the header.

The following piece of C code exemplifies an XBM file:

#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 };

In place of the usual image-file-format header, XBM files have two or four #define statements. The first two #defines specify the height and width of the bitmap in pixels. The second two, if they exist, specify the position of any hotspot within the bitmap. (Programmers use a hotspot within the image for bitmapped cursors to define where to position the "pointer" of the cursor, generally at 0,0.)

The image data consists of a line of pixel values stored in a static array. Because a single bit represents each pixel (black or white), each byte in the array contains the information for eight pixels, with the upper left pixel in the bitmap represented by the low bit of the first byte in the array. If the image width does not match a multiple of 8, the display mechanism ignores and discards the extra bits in the last byte of each row.

Support

A number of web browsers still offer support for displaying XBM images. This is a holdover from the early days of the WWW, when XBM was the minimal non-proprietary image file format. XBM support was removed from Internet Explorer 6, although it is still supported in Mozilla Firefox and some other browsers, including Safari, Opera and Chrome.

See also


 
 
Learn More
XBM (technology)
X Pixelmap (technology)
extension X-Y-Z (technology)

Map a bitmap image to another bitmap image in Photoshop? Read answer...
What is the uses of bitmap images? Read answer...
What is the abbreviation for bitmap image? Read answer...

Help us answer these
What are the disadvantages a bitmap?
When was bitmap made?
What is Bitmap representation?

Post a question - any question - to the WikiAnswers community:

 

Copyrights:

Computer Desktop Encyclopedia. THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2009 Computer Language Company Inc.  All rights reserved.  Read more
Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "X BitMap" Read more