A deck consists of the following pieces, in this order. All numbers are stored as raw binary values; the byte order of all multi-byte values is always specified explicitly. - The number of colors used by the deck, ncol (one byte). Note that the format cannot handle decks that use more than 255 colors. - The number of back designs available, nbacks (one byte). - The list of colors used. There are ncol entries in this list; each color in the list is three 16-bit numbers, being (in order) the red, green, and blue values, on a 0-65535 scale. Each number is stored most-significant byte first. When colors are referred to elsewhere, the color number is always from 0 through ncol-1 and should be taken as an index into this list. - The back designs, in black-and-white. See below for the layout of each bitmap. There are nbacks bitmaps in this list. - The card designs, in black-and-white. See below for the layout of each bitmap. There are 79 bitmaps in this list: first the clubs, ace through king, then the diamonds, ace through king, then the hearts, then the spades, then generic red, then generic black, lastly the joker. - The back designs, in color. See below for the layout of each bitmap. There are nbacks bitmaps in this list. - The card designs, in color. See below for the layout of each bitmap. There are 79 bitmaps in this list, in the same order as for the black-and-white card bitmaps. Each image is 71 pixels wide and 96 pixels high. These numbers are not stored in the file anywhere. Each black-and-white bitmap is stored as a string of 96 rows of 9 bytes each. The first eight bits of each row are stored in the first byte, left-to-right MSB-to-LSB; the next eight bits in the next byte, similarly to the end of the row; the least-significant bit of the last byte is ignored. The rows stored consecutively, topmost row first. Each color bitmap is stored as a string of 96 rows of 71 bytes each. Each byte holds one pixel of the bitmap, stored as an index into the list of colors. The pixels are stored left-to-right within each row; the rows are stored top-to-bottom within each bitmap. No attempt is made to compress the bitmaps by taking advantage of the limited range of values; the format is intended to be fast to read, not efficient to store on disk.