CD-i Image Decoding

Table of contents

C o n v e r t i n g

Requirements : You will need a Hexadecimal editor to extract a track of bytes.
You will need to install the shareware ISOBuster to extract the files (or another working tool)

Well the problem is : how do I convert CD-i pictures ? The easiest solution would be to get the picture you want to decode and then using the convert tools found at icdia.co.uk.

Unfortunately, that doesn't work because the pictures are wrapped into huge files and - what kills any chance - all "headers" of the image data are missing. Till we find a better way, here are the steps needed to see some of the pictures.

NOTICE : We've only decoded two formats : CLUT8 and RLE7 at 384px width. There are many other formats used by CD-i.

Extract the CD-i files

CD-i disks can be read by ISOBuster and you can use it to extract the files from the disk. It can took more minutes if the disk is scratched.

Extract the Track into a ISO file and then open it with ISOBuster. You should see all the CD-i files. It's recommended to extract them normally.

Find recognizable image data

We're close. You may want to use the program we made to search image automatically. However, We've tested it with only one CD-i (hotel mario) so it might not be able to find all the images. If you use the little tool below, it would be more tedious but you might get more results.

Open suspected files that may contains such data - their name usually end with .rtf - with a hex editor. Look for the string "IDAT" or this list of bytes : "0x49444154"

If the search found matches, you probably have found image data. If not, try another file.

Extract the bytes in two files - needed step for the tool

Look at the bytes before "IDAT". That should be the image palette. Extract these bytes in a separate file named image.palette.

IDAT is followed by 4 bytes indicating the number of bytes describing the pixel part (useful to know the end of the file). After these 4 bytes, the pixel part begins. Extract the pixel part in a new file, for instance "image.data". The end of this part just ends before a lot of zeros.

example

Now you have two files : a palette file and a data file, both without the 8 IDAT xxxx bytes. Now you must determine the format. RLE and CLUT images use both a palette, but the pixel part of the CLUT is uncompressed. You will notice it by looking at the bytes : each next byte is a number close to the previous one, and the file is big ? It should be a CLUT file. Other if it looks more like the example it may be RLE.

Decode into ... HTML !

It's up to you about the way you want to decode the image (see the About formats section if want some tips).

Open the suited tool (RLE drawer, Clut Drawer) and tell the program where is the palette and the data of the image. Choose a name for the HTML output file (e.g. image.html)

Beep ! You can now open the toasted HTML file.

Fixing the colors

Some colors may not appear correctly. Make sure that the palette file contains x bytes, x must be divisible by 3(each color is 3 bytes, RGB). Try to add 1 or 2 "00" bytes at the begin of the palette file and try to decode again.

P.L.