CTBL and SHAM: dynamic color tables Amiga hardware makes it possible to use a different color map for each scan line, greatly increasing the number of colors in an image. The semistandard CTBL and SHAM chunks contain per-line color maps. The more common CTBL chunk, was defined by NewTek. offset length name description ------------------------------------------------------------------------------ 0 4 ID "CTBL" 4 4 size Chunk data size, 32 times the number of rows 8 32*N cmap Color map entries ------------------------------------------------------------------------------ Each color map contains 16 entries. Each entry is two bytes. Within each entry, the low fours bit of the first byte are the red value. The high four bits of the second byte are the green value and the low four bits are the blue value. The SHAM chunk, used by other programs, is the same as CTBL except that the ID is "SHAM", there is a two-byte version field that is currently always zero before the color map, and so the length is two bytes greater than a corresponding CTBL chunk. A non-HAM image with a CTBL chunk is known as dymanic hires. A HAM image with a CTBL chunk is known as Dynamic HAM or DHAM, one with a SHAM chunk is known as Sliced HAM or SHAM.