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!
==== Pixel array (bitmap data) ==== The pixel array is a block of 32-bit DWORDs, that describes the image pixel by pixel. Usually pixels are stored "bottom-up", starting in the lower left corner, going from left to right, and then row by row from the bottom to the top of the image.<ref name="DIBhelp" /> Unless {{mono|BITMAPCOREHEADER}} is used, uncompressed Windows bitmaps also can be stored from the top to bottom, when the Image Height value is negative. In the original OS/2 DIB, the only four legal values of color depth were 1, 4, 8, and 24 bits per pixel (bpp).<ref name=DIBhelp/> Contemporary DIB Headers allow pixel formats with 1, 2, 4, 8, 16, 24 and 32 bits per pixel (bpp).<ref>MSDN - {{mono|BITMAPINFOHEADER}}: [http://msdn.microsoft.com/en-us/library/dd183376%28VS.85%29.aspx The member biBitCount]</ref> [[Graphics Device Interface|GDI+]] also permits 64 bits per pixel.<ref>{{cite web|url=http://msdn.microsoft.com/en-us/library/ms536393(v=vs.85).aspx|publisher=[[Microsoft Developer Network|MSDN]]|title=Types of Bitmaps|date=2012-06-03|access-date=2014-03-16}}</ref> Padding bytes (not necessarily 0) must be appended to the end of the rows in order to bring up the length of the rows to a multiple of four bytes. When the pixel array is loaded into memory, each row must begin at a memory address that is a multiple of 4. This address/offset restriction is mandatory only for Pixel Arrays loaded in memory. For file storage purposes, only the size of each row must be a multiple of 4 bytes while the file offset can be arbitrary.<ref name="DIBhelp" /> A 24-bit bitmap with Width=1, would have 3 bytes of data per row (blue, green, red) and 1 byte of padding, while Width=2 would have 6 bytes of data and 2 bytes of padding, Width=3 would have 9 bytes of data and 3 bytes of padding, and Width=4 would have 12 bytes of data and no padding.
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)