BMP Image: Difference between revisions
Jump to navigation
Jump to search
imported>Ikskoks |
imported>Ikskoks (→Games) |
||
| (52 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
=== Format Specifications === | === Format Specifications === | ||
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width: | <div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:1000px; overflow:auto;"> | ||
<pre> | <pre> | ||
// BMP file format (image) | // BMP file format (image) | ||
| Line 13: | Line 13: | ||
// little endian | // little endian | ||
// header | // header - 14 bytes | ||
2 bytes (char) - magic // "BM" | 2 bytes (char) - magic // "BM" | ||
4 bytes (uint32) - size of the BMP file | 4 bytes (uint32) - size of the BMP file | ||
| Line 19: | Line 19: | ||
4 bytes (uint32) - offset of image data | 4 bytes (uint32) - offset of image data | ||
// DIB header / Info header | // DIB header --> Info header (40 bytes) OR Core header (12 bytes) etc. | ||
4 bytes (uint32) - size of info header | // There are several types of DIB headers. Not all of them are documented though. | ||
// See more details in notes section. | |||
// The one described below is BITMAPINFOHEADER, used in Windows apps. | |||
// Info header | |||
4 bytes (uint32) - size of info header // "40" | |||
4 bytes (uint32) - bitmap width in pixels | 4 bytes (uint32) - bitmap width in pixels | ||
4 bytes (uint32) - bitmap height in pixels | 4 bytes (uint32) - bitmap height in pixels | ||
| Line 30: | Line 35: | ||
// "24" - 24bit RGB, num_colors=16M | // "24" - 24bit RGB, num_colors=16M | ||
// "32" - 32bit RGB | // "32" - 32bit RGB | ||
4 bytes (uint32) - compression type // "0" - BI_RGB, no compression | |||
// "1" - BI_RLE8, 8bit RLE encoding | // "1" - BI_RLE8, 8bit RLE encoding | ||
// "2" - BI_RLE4, 4bit RLE encoding | // "2" - BI_RLE4, 4bit RLE encoding | ||
| Line 40: | Line 45: | ||
// "12" - BI_CMYKRLE8 | // "12" - BI_CMYKRLE8 | ||
// "13" - BI_CMYKRLE4 | // "13" - BI_CMYKRLE4 | ||
4 bytes (uint32) - compressed image size // can be 0 if | 4 bytes (uint32) - compressed image size // can be 0 if image is uncompressed | ||
4 bytes (int32) - horizontal resolution (pixels per metre) | 4 bytes (int32) - preferred horizontal resolution (pixels per metre) | ||
4 bytes (int32) - vertical resolution (pixels per metre) | 4 bytes (int32) - preferred vertical resolution (pixels per metre) | ||
4 bytes (uint32) - number of colors in palette | 4 bytes (uint32) - number of used colors in palette // "0" for default 2^n | ||
4 | 4 byte (uint32) - number of important colors // 0=all colors | ||
// ignored in most cases | // ignored in most cases | ||
// bit masks (optional) | // bit masks (optional) | ||
x bytes - extra bit masks // occurs only for "3" and "6" | x bytes - extra bit masks // occurs only for "3" and "6" | ||
// bitfields compression types | // bitfields compression types | ||
// and ONLY when info header is present | |||
// color table / palette (optional) | // color table / palette (optional, but mandatory for color depths <= 8 bits ) | ||
// e.g. Palette can have 756 bytes in RGB24 format when Core Header is present and image is 8bpp type | |||
// e.g. Palette can have 1024 bytes in RGBA32 format | |||
x bytes - palette data | x bytes - palette data | ||
| Line 65: | Line 74: | ||
=== Notes and Comments === | === Notes and Comments === | ||
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 '''BITMAPCOREHEADER''' and '''BITMAPINFOHEADER''' used mostly in Windows applications. | |||
=== Games === | === Games === | ||
List of games using this file format: | List of games using this file format: | ||
* 0 A.D. (*.BMP) (PC) | |||
* Animal Paradise Tycoon (*.BMP) (PC) | |||
* Bugatron Worlds (*.BMP) (PC) | |||
* Disney's Stitch: Experiment 626 (*.BMP) (PS2) | |||
* [[Giana’s Return]] (*.BMP) (PC) | |||
* High Heat Baseball 2000 | * High Heat Baseball 2000 | ||
* Killer Tank | * Killer Tank | ||
* Little Fighter 2 (*.BMP) (PC) | |||
* Platypus (*.BMP) (PC) | |||
* Rigs of Rods (*.BMP) (PC) | |||
* [[SpongeBob SquarePants: Operation Krabby Patty]] | * [[SpongeBob SquarePants: Operation Krabby Patty]] | ||
* | * Z-Ball (*.BMP) (PC) | ||
* Many more... | * Many more... | ||
| Line 83: | Line 101: | ||
* Paint.NET | * Paint.NET | ||
* IrfanView | * IrfanView | ||
=== See Also === | |||
* [https://cdn.hackaday.io/files/274271173436768/Simplified%20Windows%20BMP%20Bitmap%20File%20Format%20Specification.htm BMP Format] | |||
<br><br> | <br><br> | ||
Latest revision as of 15:55, 30 June 2022
BMP
- Format Type : Image
- Endian Order : Little Endian
Format Specifications
// BMP file format (image)
// little endian
// header - 14 bytes
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.
// There are several types of DIB headers. Not all of them are documented though.
// See more details in notes section.
// The one described below is BITMAPINFOHEADER, used in Windows apps.
// Info header
4 bytes (uint32) - size of info header // "40"
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
4 bytes (uint32) - 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 image is uncompressed
4 bytes (int32) - preferred horizontal resolution (pixels per metre)
4 bytes (int32) - preferred vertical resolution (pixels per metre)
4 bytes (uint32) - number of used colors in palette // "0" for default 2^n
4 byte (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
// and ONLY when info header is present
// color table / palette (optional, but mandatory for color depths <= 8 bits )
// e.g. Palette can have 756 bytes in RGB24 format when Core Header is present and image is 8bpp type
// e.g. Palette can have 1024 bytes in RGBA32 format
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 BITMAPCOREHEADER and BITMAPINFOHEADER used mostly in Windows applications.
Games
List of games using this file format:
- 0 A.D. (*.BMP) (PC)
- Animal Paradise Tycoon (*.BMP) (PC)
- Bugatron Worlds (*.BMP) (PC)
- Disney's Stitch: Experiment 626 (*.BMP) (PS2)
- Giana’s Return (*.BMP) (PC)
- High Heat Baseball 2000
- Killer Tank
- Little Fighter 2 (*.BMP) (PC)
- Platypus (*.BMP) (PC)
- Rigs of Rods (*.BMP) (PC)
- SpongeBob SquarePants: Operation Krabby Patty
- Z-Ball (*.BMP) (PC)
- Many more...
Compatible Programs
- Game Extractor
- GIMP
- Adobe Photoshop
- MS Paint
- Paint.NET
- IrfanView
See Also