(2nd Draft) Format for images in BATTLE: Size and offset are both in bytes. MSB is first, then LSB. So conversions may have to take place (intel platforms). Size | Offset | Description 1 | 0 | A byte containing the number of Bits per pixel 1 | 1 | 1 for truecolor (grayscale or color) 0 for palette based 4 | 2 | DWORD containing horizontal size 4 | 6 | DWORD containing vertical size n | 10 | Raster data (see below) 768 | 10 + n | Palette data (see below) Raster data is store as: 8bpp Palette ------------ The image will be stored as a series of raster lines. Each pixel is represented by one byte. This byte is used as an index into the palette data. Images are stored Top-Down (not bottom-up like BMP files). 8bpp Grayscale -------------- The image will be stored as a series of raster lines. Each pixel is represented by one byte. This byte is used as the gray level. A value of 255 is white, and a value of 0 is black. There is no palette data stored after a grayscale image 24bpp Color ----------- The image will be stored as a series of raster lines. Each pixel is represented by three bytes. One byte for red, green and blue intensities (in that order). A value of 255 is full (red, green or blue) and a value of 0 is no intensity. There is no palette data stored after a 24bpp color image. Palette Data ------------ The palette data is stored as an array of 256 three byte triplets. For each of the 256 possible colors there are 3 bytes, one for red, green and blue (in that orer). Like 24bpp color, a value of 255 is full intensity and 0 is no intensity. These palette values may have to be scaled down to work with some hardware. For example for the VGA you will have to divide by 4 for each intensity.