ArticleslgStudy

science

ILBM

ILBM is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand ILBM rather than just read about it. In short: Interleaved Bitmap (ILBM) is an image file format conforming to the Interchange File Format (IFF) standard. The format originated on the Amiga platform, and on IBM-compatible systems, files in this format or the related PBM (Planar Bitmap) format are typically encountered in games from late 1980s and early 1990s that were either Amiga ports or had their graphical assets designed on Amiga machines.

ILBM — main illustration
ILBM — illustration

Key takeaways

  • ILBM belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect ILBM to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of ILBM from memory before moving on to harder problems.

Reference excerpt

Interleaved Bitmap (ILBM) is an image file format conforming to the Interchange File Format (IFF) standard. The format originated on the Amiga platform, and on IBM-compatible systems, files in this format or the related PBM (Planar Bitmap) format are typically encountered in games from late 1980s and early 1990s that were either Amiga ports or had their graphical assets designed on Amiga machines. A characteristic feature of the format is that it stores bitmaps in the form of interleaved bit planes, which gives the format its name; this reflects the way the Amiga graphics hardware natively reads graphics data from memory. PackBits, a simple form of compression is supported to make ILBM files more compact. On the Amiga, these files are not associated with a particular file extension, though as they started being used on PC systems where extensions are systematically used, they employed a .lbm or occasionally a .pbm extension.

File format ILBM is an implementation of the IFF file format consisting 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. ILBM 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 ILBMs the BMHD (Bit Map HeaDer) 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.

BMHD: Bitmap header 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:

BODY: Image data 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. In PBM files, the BODY chunk is simpler as uncompressed it is just a continuous stream of bytes containing image data.

Compression If an image is compressed, each row of data (but not each bitplane) is compressed individually, including the mask data if present. The compression is a variety of run-length encoding (RLE) using flags. It can be decoded as follows:

Loop until we have [Final length] bytes worth of data (final length calculated from image size.) While [Decompressed data length] < [Final length]: Read a byte [Value] If [Value] > 128, then: Read the next byte and output it (257 - [Value]) times. Move forward 2 bytes and return to step 1. Else if [Value] < 128, then: Read and output the next [value + 1] bytes Move forward [Value + 2] bytes and return to step 1. Else [Value] = 128, exit the loop (stop decompressing) For the compression routine, it's best to encode a 2 byte repeat run as a replicate run except when preceded and followed by a literal run, in which case it is best to merge the three into one literal run. Always encode >3 byte repeats as replicate runs.

CAMG: Amiga mode A CAMG chunk is specifically for the Commodore Amiga computer. It stores a LONG "viewport mode". This lets you specify Amiga display modes like "dual playfield" and "hold and modify". It is, not surprisingly, rare outside of Amiga games.

If you need to convert or display files that might contain meaningful CAMG chunks, see the 'Notes on working with ILBM files' below.

CMAP: Palette The CMAP chunk contains the image's palette and consists of 3-byte RGB values for each colour used. Each byte is between 0 and 255 inclusive. The chunk is 3 × numColours bytes long. The number of colours in the palette will be 2 ^ numBitplanes. This chunk is optional and a default palette will be used if it is not present. It is possible to have fewer entries than expected (e.g. 7 colours for a 4-plane '16 colour' bitmap for example.) Remember that if this has an odd number of colours, as per the IFF specification the chunk will be padded by one byte to make it an even number of bytes long, but the pad byte is not included in the chunk's length field.

CRNG: Colour range The colour range chunk is 'nonstandard'. It is used by Electronic Arts' Deluxe Paint program to identify a contiguous range of colour registers or a "shade range" and colour cycling. There can be zero or more CRNG chunks in an ILBM file, but all should appear before the BODY chunk. Deluxe Paint normally writes 4 CRNG chunks in an ILBM when the user asks it to "Save Picture".

CCRT: Colour cycling Commodore's Graphicraft program uses CCRT for Colour Cycling Range and Timing. This chunk contains a CycleInfo structure. Like CRNG it is a nonstandard chunk.

The data is similar to a CRNG chunk. A program would probably only use one of these two methods of expressing colour cycle data. You could write out both if you want to communicate this information to both DeluxePaint and Graphicraft.

DEST: Bitplane combining The optional property DEST is a way to control how to scatter zero or more source bitplanes into a deeper destination image. Some readers may ignore DEST.

… excerpt ends here. Continue reading the full article.

Illustrations

ILBM illustration

Worked examples

Example 1 — a first encounter with ILBM

Start with the simplest possible case. Write down what ILBM claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to ILBM before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about ILBM ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of ILBM

In research
ILBM appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses ILBM in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
ILBM is common in secondary-school and first-year university syllabi. It links to neighbouring topics AmigaOS, Graphics file formats, MorphOS, so understanding it makes those chapters shorter.
In everyday life
Look for ILBM outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “ILBM” →

How to study ILBM in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what ILBM means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain ILBM out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is ILBM in simple terms?

Interleaved Bitmap (ILBM) is an image file format conforming to the Interchange File Format (IFF) standard. The format originated on the Amiga platform, and on IBM-compatible systems, files in this format or the related PBM (Planar Bitmap) format are typically encountered in games from late 1980s a…

Why does ILBM matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study ILBM?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on ILBM.

Tags

  • AmigaOS
  • Graphics file formats
  • MorphOS

Keep exploring