IFF/ILBM Javascript library

This page describes a small project of mine, a javascript library that parses IFF/ILBM files and displays them in an HTML5 canvas. Images of this type were very common on the Amiga platform. The library was introduced in this post, the library itself can be found on github. The source code is available under the BSD license.

The library currently handles the following image types:

  • Color palette images
  • EHB (Extra Half-Bright) images
  • HAM (Hold & Modify) images, both HAM-6 and HAM-8 variants
  • RGB-24 images.
  • SHAM (Sliced HAM) images

The library handles the following features:

  • Uncompressed and Packbit compressed data
  • Non square pixel rendering
  • Colour-palette animations
  • Textual annotations
  • Proper scaling of 4 bit palettes

Beware that serving an ILBM/IFF file from a web-server and displaying it client side is not very efficient, for palette, EHB and RGB-24 images, the equivalent PNG file will always be more compact. Even HAM images are not that compact, the file Angel.iff is 70824 bytes long. A properly optimised PNG file with the same data is 43857 bytes long.

HAM image
For This, an ILBM file with an animated colour palette, created by Vector (Peter Szalkai)

5 thoughts on “IFF/ILBM Javascript library”

  1. This is brilliant. I would very much like to use your library in my just-for-fun project called TAWS – The Amiga Workbench Simulation (www.taws.ch). The goal is to simulate the Amiga Workbench as true as possible in web browsers. And it would be great to be able to display/play original Amiga files in it. I already wrote an AmigaGuide parser and included a 3rd party library for playing tracker modules. The ability to display IFF ILBM files would be really great. Would I have your consent in doing so? Of course I’d include your name in the copyright notice.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.