Filename extension |
|
---|---|
Developed by | Electronic Arts |
Initial release | 14 January 1985 |
Type of format | Image file formats |
Contained by | Interchange File Format |
Standard | EA IFF 85: Standard for Interchange Format |
Open format? | Public domain source code |
The LBM file extension is an image file in Interchange File Format (IFF) structure to store image or palette data. Most commonly you can find these files in InterLeaved BitMap (ILBM) format, but some games are using a similar, but simpler-to-use Planar BitMap (PBM) format. Both formats commonly exist under the .lbm file extension, occasionally appearing also as .bbm extension.
ILBM and PBM formats are used by games from late 80s and early 90s that either originated from Amiga platform or had their assets such as graphics done on Amiga.
In essence LBM files consist of a number of consecutive chunks, whose order can, to some extent, be varied. Each chunk has a different function and has the same basic format. This means that a program does not have to read or decode every chunk in a file, only the ones it wants to deal with or the ones it can understand. For example, a program might use a TIME chunk to store the date and time that a file was last edited. Another program does not need to know about this and can just skip the chunk and leave it unchanged, or drop the chunk entirely, although that is not an advisable thing for a tool to do automatically.
For details on the chunk structure and how to read them, see Interchange File Format (IFF).
LBM files usually contain enough information to allow them to be displayed by an image editing program, including image dimensions, palette and pixel data. Some files were designed to act as palettes for paint programs (pixel data left blank) or to be merged into another image. This makes them much more flexible, but also much more complex than other formats such as BMP.
For LBMs the BMHD chunk and any other 'vital' chunks must appear before the BODY chunk. Any chunks appearing after BODY are considered 'extra' and many programs will leave them unread and unchanged.
There are many possible chunk types. However, there are only a limited number of common chunk types used and understood by most programs, and descriptions of these follow. Again refer to Interchange File Format for further detail about finding and handling chunks.
The BMHD chunk specifies how the image is to be displayed and is usually the first chunk inside the FORM. It not only defines the image's height/width, but where it is drawn on the screen, how to display it in various screen resolutions and if the image is compressed. The content of this chunk is as follows:
The BODY chunk is usually the last chunk in a file, and the largest.
In ILBM files the BODY chunk stores the actual image data as interleaved bitplanes (and optional mask) by row. The bitplanes appear first from 1 to n, followed by the mask plane. If the image is uncompressed then each line will be made up of (width + 15) / 16
16-bit values (i.e. one bit per pixel, rounded up to the nearest multiple of 16-bits.) If it is compressed then each line is compressed individually and is always a multiple of 16-bits long when compressed.