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 format cannot handle decks for which any of the first five numbers are outside the range 0..255. - A version number (one byte). This document describes version 0. - The number of colours used by the deck, ncol (one byte). - The number of back designs available, nbacks (one byte). - The X size of a card image in pixels, xsize (one byte); - The Y size of a card image in pixels, ysize (one byte); - The list of colours used. There are ncol entries in this list; each colour 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 colours are referred to elsewhere, the colour 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 81 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, finally the generic unranked red, generic unranked black, and lastly the joker. - The back designs, in colour. See below for the layout of each bitmap. There are nbacks bitmaps in this list. - The card designs, in colour. See below for the layout of each bitmap. There are 81 bitmaps in this list, in the same order as for the black-and-white card bitmaps. Each black-and-white bitmap is stored as a string of ysize rows of ceil(xsize/8) 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; if xsize is not a multiple of 8, one or more least-significant bit(s) of the last byte is/are ignored. The rows are stored consecutively, topmost row first. Each colour bitmap is stored as a string of ysize rows of xsize bytes each. Each byte holds one pixel of the bitmap, stored as an index into the list of colours. 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 take advantage of any of the opportunities to compress the bitmaps; the format is intended to be fast to read, not efficient to store on disk.