00 00 00 12 - standard pix header 00 00 00 08 00 00 00 02 00 00 00 02 repeat the sections below for each image in the pix file 00 00 00 03 - C1 pix header 00 00 00 xx - size of block. 11 + len(filename) + 1 03 - type: 8bit pix xx xx - rowsize, see note #1 xx xx - width xx xx - height xx xx - halfwidth (for odd widths use: (oddwidth-1)/2) xx xx - halfheight (for odd heights use: (oddheight-1)/2) ?? - filename 00 - single 00 byte to signify end of filename 00 00 00 21 - C1 pix data xx xx xx xx - size of block. 8 + (rowsize*height) xx xx xx xx - number of pixels (width*height) 00 00 00 01 - pixelsize (1 byte for standard 8bit pix) image data goes - 1 byte per pixel, index of colour in C1 palette, see note #2 00 00 00 00 - end of pix block 00 00 00 00 ======================================================== notes: #1 rowsize if both width and halfwidth are even then: rowsize = width * pixelsize if halfwidth is even then: rowsize = ((halfwidth + 2) * 2) * pixelsize if halfwidth is odd then: rowsize = ((halfwidth + 1) * 2) * pixelsize examples. pix with a type of 3 always have a pixelsize of 1. width 47 halfwidth 23 pixelsize 1 rowsize 48 = ((halfwidth + 1) * 2) * pixelsize width 34 halfwidth 17 pixelsize 1 rowsize 36 = ((halfwidth + 1) * 2) * pixelsize width 85 halfwidth 42 pixelsize 1 rowsize 88 = ((halfwidth + 2) * 2) * pixelsize width 64 halfwidth 32 pixelsize 1 rowsize 64 = width * pixelsize #2 image data. if rowsize > width then write the width followed by (rowsize-width) 00 records example: width 9 rowsize 10 first row A1 A2 A3 A4 A5 A6 A7 A8 A9 written as A1 A2 A3 A4 A5 A6 A7 A8 A9 00