Talk:X BitMap

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computer graphics (Rated Stub-class)
WikiProject icon This article is within the scope of WikiProject Computer graphics, a collaborative effort to improve the coverage of computer graphics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Stub-Class article Stub  This article has been rated as Stub-Class on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.


What software can create these? PaintShop Pro doesn't recognize them. Drutt (talk) 15:35, 11 February 2009 (UTC)

answer: For example GIMP can be used to edit xbm files. -- (talk) 07:17, 5 October 2009 (UTC)

Dare I ask why you want to use this format? — Smjg (talk) 12:22, 29 September 2011 (UTC)
It's great for embedding shapes in C code. -- (talk) 22:31, 30 March 2012 (UTC)
If you look at XBM as an image format, it might look very clumbsy and inefficient. But if you see it as C code, that is about to be compiled, it is actually very efficient and lean. And it's easy to use... I mean you can generate that C code with a graphic program, and you can simply include it in a C program with #include "circle.xbm"! (talk) 09:48, 2 May 2012 (UTC)
But if you're a programmer, you might as well write a program to generate an XBM file yourself! — Smjg (talk) 13:30, 11 December 2012 (UTC)

4 bytes?[edit]

Why 4?

I've probably only read 2 or 3 webpages about how the format works, but the examples they give use 6 bytes per byte of image data in the same way as here.

At the moment, I can only guess that:

  • The space after the comma isn't required. But then why do the examples always include it? Just to exaggerate for effect how bad the format is?
  • A byte can be represented with a single hex digit, as "0x6," which is two characters shorter than "0x06, ".
  • However, it isn't legal to write the byte value as a C octal or decimal literal.

Am I right? It would be nice to find the XBM spec and link to it. In any case, this point needs clarifying. — Smjg (talk) 12:22, 29 September 2011 (UTC)

Because each byte is 8 bits. 8 bits -> 0-255. The comma is required, that gives for example: '211,' (4 bytes) Mitikoro (talk) 18:07, 1 November 2011 (UTC)

In that case, surely byte values below 100 can be written in fewer bytes, and so the claim that each byte of image data takes up at least 4 bytes is false. Or are such values when written in decimal required to be space-padded, as "  6," or " 42,"? — Smjg (talk) 22:08, 30 November 2011 (UTC)
They're not commonly written in decimal for XBM format, and probably some programs wouldn't be able to handle decimal numbers... AnonMoos (talk) 02:56, 1 December 2011 (UTC)
Is XBM commonly used in the first place in this day and age? Besides, neither commonness nor software compatibility is part of the point here. The point is what is the smallest possible number of bytes a data byte can take up per the XBM spec. — Smjg (talk) 10:37, 2 December 2011 (UTC)


When was this format first developed? Is there an official specification? Have there been any significant changes in the specification? - dcljr (talk) 02:02, 14 February 2012 (UTC)

It's presumably based on excerpts from the reams of documentation for the X windowing system; don't know if these were ever separated out as any kind of formal standards specification in the way that you're thinking... AnonMoos (talk) 10:51, 14 February 2012 (UTC)