Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
BMP file format
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Example 1 === Following is an example of a 2Γ2 pixel, 24-bit bitmap (Windows DIB header {{mono|BITMAPINFOHEADER}}) with pixel format RGB24. {| class="wikitable" ! Offset (hex) ! Size (bytes) ! Hex value ! Value ! Description |- | colspan="5" style="text-align: center;" | BMP Header |- | align="center" |00 | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|42 4D | style="padding: 0px 10px"|"BM" | style="padding: 0px 10px"|ID field (42h, 4Dh) |- | align="center" |02 | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|46 00 00 00 | style="padding: 0px 10px"|70 bytes (54+16) | style="padding: 0px 10px"|Size of the BMP file (54 bytes header + 16 bytes data) |- | align="center" |06 | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 | style="padding: 0px 10px"|Unused | style="padding: 0px 10px"|Application specific |- | align="center" |08 | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 | style="padding: 0px 10px"|Unused | style="padding: 0px 10px"|Application specific |- | align="center" |0A | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|36 00 00 00 | style="padding: 0px 10px"|54 bytes (14+40) | style="padding: 0px 10px"|Offset where the pixel array (bitmap data) can be found |- | colspan="5" style="text-align: center;" | DIB Header |- | align="center" |0E | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|28 00 00 00 | style="padding: 0px 10px"|40 bytes | style="padding: 0px 10px"|Number of bytes in the DIB header (from this point) |- | align="center" |12 | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|02 00 00 00 | style="padding: 0px 10px"|2 pixels (left to right order) | style="padding: 0px 10px"|Width of the bitmap in pixels |- | align="center" |16 | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|02 00 00 00 | style="padding: 0px 10px"|2 pixels (bottom to top order) | style="padding: 0px 10px"|Height of the bitmap in pixels. Positive for bottom to top pixel order. |- | align="center" |1A | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|01 00 | style="padding: 0px 10px"|1 plane | style="padding: 0px 10px"|Number of color planes being used |- | align="center" |1C | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|18 00 | style="padding: 0px 10px"|24 bits | style="padding: 0px 10px"|Number of bits per pixel |- | align="center" |1E | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 00 00 | style="padding: 0px 10px"|0 | style="padding: 0px 10px"|BI_RGB, no pixel array compression used |- | align="center" |22 | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|10 00 00 00 | style="padding: 0px 10px"|16 bytes | style="padding: 0px 10px"|Size of the raw bitmap data (including padding) |- | align="center" |26 | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|13 0B 00 00 | style="padding: 0px 10px"|2835 pixels/metre horizontal | style="padding: 0px 10px" rowspan="2"|Print resolution of the image,<br />[[Dots per inch|72 DPI]] Γ 39.3701 inches per metre yields 2834.6472 |- | align="center" |2A | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|13 0B 00 00 | style="padding: 0px 10px"|2835 pixels/metre vertical |- | align="center" |2E | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 00 00 | style="padding: 0px 10px"|0 colors | style="padding: 0px 10px"|Number of colors in the palette |- | align="center" |32 | align="center" |4 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 00 00 | style="padding: 0px 10px"|0 important colors | style="padding: 0px 10px"|0 means all colors are important |- | colspan="5" align="center"|Start of pixel array (bitmap data) |- | align="center" |36 | align="center" |3 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 FF | style="padding: 0px 10px"|0 0 255 | style="padding: 0px 10px"|Red, Pixel (x=0, y=1) |- | align="center" |39 | align="center" |3 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|FF FF FF | style="padding: 0px 10px"|255 255 255 | style="padding: 0px 10px"|White, Pixel (x=1, y=1) |- | align="center" |3C | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 | style="padding: 0px 10px"|0 0 | style="padding: 0px 10px"|Padding for 4 byte alignment (could be a value other than zero) |- | align="center" |3E | align="center" |3 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|FF 00 00 | style="padding: 0px 10px"|255 0 0 | style="padding: 0px 10px"|Blue, Pixel (x=0, y=0) |- | align="center" |41 | align="center" |3 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 FF 00 | style="padding: 0px 10px"|0 255 0 | style="padding: 0px 10px"|Green, Pixel (x=1, y=0) |- | align="center" |44 | align="center" |2 | style="padding: 0px 20px; white-space: nowrap; font-family:monospace;"|00 00 | style="padding: 0px 10px"|0 0 | style="padding: 0px 10px"|Padding for 4 byte alignment (could be a value other than zero) |}{{clear|left}} <imagemap> File:Bmp_format2.svg|frame|right|[[#Example 2|Example 2]] of a 4Γ2 pixel bitmap, with 32 bits/pixel encoding rect 50 50 100 100 [[#Transparency|0,0: blue 0000FF FF]] rect 100 50 150 100 [[#Transparency|0,1: green 00FF00 FF]] rect 150 50 200 100 [[#Transparency|0,2: red FF00000 FF]] rect 200 50 250 100 [[#Transparency|0,3: white FFFFFF FF]] rect 50 100 100 150 [[#Transparency|1,0: blue 0000FF 7F, half transparent]] rect 100 100 150 150 [[#Transparency|1,1: green 00FF00 7F, half transparent]] rect 150 100 200 150 [[#Transparency|1,2: red FF0000 7F, half transparent]] rect 200 100 250 150 [[#Transparency|1,3: white FFFFFF 7F, half transparent]] default [[Netpbm#Transparency]] desc top-left </imagemap>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)