---HEADER--- The file begins with the header section. 4 bytes -1st byte is random, the rest follow a sequence; makes sure the file is the right type. 2 bytes -size the 'meta block' is; a section of the header that contains any file info strings to be embedded. X bytes -the meta-block. -a section of this will follow this format: 1 byte - length of block name (e.g. 4) X bytes - block name (e.g. "name") 2 bytes - length of block data (e.g. 14) x bytes - block data (e.g. "my spritesheet") 2 bytes -number of sprites in the spritesheet 2 bytes -width of each sprite 2 bytes -height of each sprite 1 byte -# of masks used; 1-4 normally, higher would throw an error ---DATA--- The data section of the file follows here. The data is represented sprite-at-a-time, from the top left of each sprite to the bottom right. --PER PIXEL-- 5 bits -red value of pixel; * 8 to get 0-248 value 5 bits -green value of pixel; * 8 to get 0-248 value 5 bits -blue value of pixel; * 8 to get 0-248 value 5 bits -alpha value of pixel; * 8 to get 0-248 value 1 bit - mask 1; on or off for this pixel 1 bit - mask 2; on or off for this pixel 1 bit - mask 3; on or off for this pixel 1 bit - mask 4; on or off for this pixel