------------------------------------------------------------------------------- Each page of a document has three layers... I use 'ddjvu' command to see the three layers: ddjvu -mode=mask -v myfile.djvu mask.ppm ddjvu -mode=foreground -v myfile.djvu foreground.ppm ddjvu -mode=background -v myfile.djvu background.ppm =============================================================================== Format The first 4 octets is the identifier AT&T (0x41 0x54 0x26 0x54) The next 8 is a 'FORM' chunk wrapping the whole file. That is the letters FORM, then a 32 bit number (most-significate first) holding the length of the data in that top level CHUNK. EG: The file length should be that first chunks length + 12 Data lengths much be even in size use zero pad if needed. The next four bytes is secondary chunk identifier DJVU (compound), PM44 (color), BM44 (greyscale) After that is all image data. (Except in the djvu documents given with the djvu package this is DJVM!) ===============================================================================