CD-i Image Decoding

Table of contents

F o r m a t s

This part describes what I know about image formats.

CD-i's CLUT 8

The CLUT8 (Color Look Up Table, 8bits/pixels) is an uncompressed image format.

At the begin of a CLUT8 file there is a header (describing dimensions of the image but seems to be not in the CD-i files).
Then, there is the palette with the color codes. The first color (e.g. 10 10 FF) is the color 0, the second is the color 1, etc... The palette ends with the characters "IDAT". The next 4 bytes are the remaining length of the file.

Next part, each byte describe one pixel with a code reffering to the color read before in the palette.

If the header is not present, you have to guess the width. The width of these images usually is 384 pixels.

Other references :

http://en.wikipedia.org/wiki/CLUT
http://www.ascilite.org.au/aset-archives/confs/iims/1992/shaw.html

CD-i's RLE 7

The CD-i RLE7 is similar to CLUT8 but it's a compressed format. However its size is generally smaller, its palette may not contains more than 128 colors (against 256 for CLUT 8). RLE is one of the simplest compression methods. Here are the rules.

example

For example, we have an image 2x4 pixels with two colors. if the pixel part is the next 5 hexa bytes : 0x80 0x00 0x01 0x00 0x81 0x00, the output will be :

0000
1011

P.L.