BMP Image: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
imported>Ikskoks
Line 69: Line 69:


* Generic Bitmap *.bmp Image.
* Generic Bitmap *.bmp Image.
* There are different kinds of DIB headers available in this format: <br>BITMAPCOREHEADER (12 bytes) <br>OS22XBITMAPHEADER (64 bytes) <br>OS22XBITMAPHEADER (16 bytes) <br>BITMAPINFOHEADER (40 bytes) <br>BITMAPV2INFOHEADER (52 bytes) <br>BITMAPV3INFOHEADER (65 bytes) <br>BITMAPV4HEADER (108 bytes) <br>BITMAPV5HEADER (124 bytes) <br>but the most common ones are Info Header and Core eader.
* There are different kinds of DIB headers available in this format: <br>BITMAPCOREHEADER (12 bytes) <br>OS22XBITMAPHEADER (64 bytes) <br>OS22XBITMAPHEADER (16 bytes) <br>BITMAPINFOHEADER (40 bytes) <br>BITMAPV2INFOHEADER (52 bytes) <br>BITMAPV3INFOHEADER (65 bytes) <br>BITMAPV4HEADER (108 bytes) <br>BITMAPV5HEADER (124 bytes) <br>but the most common ones are Info Header and Core header used mostly in Windows applications.


=== Games ===
=== Games ===

Revision as of 13:29, 5 January 2021

BMP


Format Specifications

// BMP file format (image)

// little endian

// header
2 bytes (char) - magic // "BM"
4 bytes (uint32) - size of the BMP file
4 bytes - reserved
4 bytes (uint32) - offset of image data

// DIB header --> Info header (40 bytes) OR Core header (12 bytes) etc.
// See more details in notes below.

// Info header
4 bytes (uint32) - size of info header
4 bytes (uint32) - bitmap width in pixels
4 bytes (uint32) - bitmap height in pixels
2 bytes (uint16) - number of color planes   // must be "1"
2 bytes (uint16) - number of bits per pixel // "1" - monochrome pelette, num_colors=1
                                            // "4" - 4bit palettized, num_colors=16
                                            // "8" - 8bit palettized, num_colors=256
                                            // "16" - 16bit RGB, num_colors=65536
                                            // "24" - 24bit RGB, num_colors=16M
                                            // "32" - 32bit RGB
2 bytes (uint16) - compression type  // "0" - BI_RGB, no compression
                                     // "1" - BI_RLE8, 8bit RLE encoding
                                     // "2" - BI_RLE4, 4bit RLE encoding
                                     // "3" - BI_BITFIELDS, Huffman 1D 
                                     // "4" - BI_JPEG, RLE-24
                                     // "5" - BI_PNG 
                                     // "6" - BI_ALPHABITFIELDS 
                                     // "11" - BI_CMYK 
                                     // "12" - BI_CMYKRLE8 
                                     // "13" - BI_CMYKRLE4 
4 bytes (uint32) - compressed image size   // can be 0 if compression=0
4 bytes (int32) - horizontal resolution (pixels per metre)
4 bytes (int32) - vertical resolution (pixels per metre)
4 bytes (uint32) - number of colors in palette
4 bytes (uint32) - number of important colors  // 0=all colors 
                                               // ignored in most cases

// bit masks (optional)   
x bytes - extra bit masks   // occurs only for "3" and "6" 
                            // bitfields compression types

// color table / palette (optional)
x bytes - palette data

// pixel array
x bytes - image data

MultiEx BMS Script

Not written yet.

Notes and Comments

  • Generic Bitmap *.bmp Image.
  • There are different kinds of DIB headers available in this format:
    BITMAPCOREHEADER (12 bytes)
    OS22XBITMAPHEADER (64 bytes)
    OS22XBITMAPHEADER (16 bytes)
    BITMAPINFOHEADER (40 bytes)
    BITMAPV2INFOHEADER (52 bytes)
    BITMAPV3INFOHEADER (65 bytes)
    BITMAPV4HEADER (108 bytes)
    BITMAPV5HEADER (124 bytes)
    but the most common ones are Info Header and Core header used mostly in Windows applications.

Games

List of games using this file format:

Compatible Programs