Another version of this could be to eradicate the chunk headers and simply store the dimensions of each bitmap in the CMPHeader. These dimensions would apply to every image in the file. Then you could just write out the raw data for all bitmaps in RLE form. To read it, you would only need to know the dimensions and you could correctly extract the data. This would cut the size of the file tremendously. Of course the palette would still be in the last 768 bytes.