Flux rss

The BMP format

The BMP format

The BMP is one of the simplest formats. It was jointly developed by Microsoft and IBM, which explains why it is particularly widespread on Windows and OS/2 platforms. A BMP file is a bitmap file, i.e. a graphic image file, with pixels stored in the form of point table and managing the colours either as true colours or using an indexed palette. The BMP format has been studied in such a way as to obtain a bitmap that is independent of the peripheral display device (DIB, Device independent bitmap).

The structure of a bitmap file is the following:

File header

The file header provides information on the type of file (Bitmap) and its size as well as indicating where information concerning the image actually starts.

The header comprises four fields:

  • The signature (on 2 bytes), indicating that it is a BMP file, using two characters
    • BM, 424D in hexadecimal, indicates that it is a Windows Bitmap.
    • BA indicates that it is an OS/2 Bitmap.
    • CI indicates that it is an OS/2 colour icon.
    • CP indicates that it is an OS/2 colour pointer.
    • IC indicates that it an OS/2 icon.
    • PT indicates that it is an OS/2 pointer.
  • The total size of the file in bytes (coded on 4 bytes)
  • A reserved field (on 4 bytes)
  • The offset of the image (on 4 bytes), that is, it is the location of the start of the image information relative to the start of the file

Bitmap information header

The bitmap information header provides information on the image, particularly its dimensions and its colours.

The bitmap information header comprises four fields:

  • The size of the bitmap information header in bytes (coded on 4 bytes). The following hexadecimal values are possible according to the type of BMP format:
    • 28 for Windows 3.1x, 95, NT…
    • 0C for OS/2 1.x
    • F0 for OS/2 2.x
  • The width of the image (on 4 bytes), i.e. the number of pixels counted horizontally
  • The height of the image (on 4 bytes), i.e. the number of pixels counted vertically
  • The number of planes (on 2 bytes). This value is always 1
  • The colour model depth of (on 2 bytes), i.e. the number of bits used to code the colour. This value may be equal to 1, 4, 8,16, 24 or 32
  • The compression method (on 4 bytes). This value is 0 when the image is not compressed, or either 1, 2 or 3 depending on the type of compression used:
    • 1 for RLE coding of 8 bits per pixel
    • 2 for RLE coding of 4 bits per pixel
    • 3 for bitfield coding, meaning that the colour is coded by a triple mask represented by the palette
  • The total size of the image in bytes (on 4 bytes).
  • The horizontal resolution (on 4 bytes), i.e. the number of pixels per metre counted horizontally
  • The vertical resolution (on 4 bytes), i.e. the number of pixels per metre counted vertically
  • The number of palette colours (on 4 bytes)
  • The number of important palette colours (on 4 bytes). This field may be equal to 0 when all colours are important.

Image palette

The palette is optional. When a palette is defined, it contains 4 bytes successively for each of its entries, representing:

  • The blue component (on one byte)
  • The green component (on one byte)
  • The red component (on one byte)
  • A reserved field (on one byte)

Image coding

The coding of the image is done by successively writing the bits corresponding to each pixel, line by line, starting with the pixel in the bottom left-hand corner.

  • 2-Colour images use 1 bit per pixel, which means that one byte allows 8 pixels to be coded
  • 16-Colour images use 4 bits per pixel, which means that one byte allows 2 pixels to be coded
  • 256-Colour images use 8 bits per pixel, which means that one byte is needed to code each pixel
  • Real colour images use 24 bits per pixel, which means that 3 bytes are needed to code each pixel, taking care to respect the alternating colour order for blue, green and red.
Each image line must comprise a total number of bytes that is a multiple of 4; if this is not the case, the line must be completed with as many 0 as necessary in order to respect this criterion.

Last update on Thursday October 16, 2008 02:43:16 PM.
This document entitled « The BMP format » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Results for The BMP format

Copy the files in the same format. Hello, i can't download pictures in the same format from the internet. Ex: the system show the extension .bmp or jpg instead of .gif en.kioskea.net/forum/affich-20115-copy-the-files-in-the-same-format
Download Free Word/Doc Txt to Image Jpg/Jpeg Bmp Tiff Png It is usually the images that we insert into Word, Excel or PowerPoint documents. This time, it is the opposite, because we are going to convert these documents to image formats. All to Jpg / JPEG Image Bmp Tiff Png Converter is a powerful tool which... en.kioskea.net/telecharger/telecharger-1630-free-word-doc-txt-to-image-jpg-jpeg-bmp-tiff-png
Download PDF Action Free PDF Reader PDF Action PDF Reader is a simple and powerful editor of document PDF. He allows to print documents, to open 17 documents all at once. Documents PDF can be exported in format picture: jpg, bmp.Every tools am represented by a description translated... en.kioskea.net/telecharger/telecharger-845-pdf-action-free-pdf-reader

Results for The BMP format

How to add an image to your websiteHow to add an image to your website The codes usually used to add an image to your website are if you have to upload a JPEG format but can also bear a BMP, PNG or GIF extension. This option is used while browsing an... en.kioskea.net/faq/sujet-565-how-to-add-an-image-to-your-website
Inserting animated gifInserting animated gif An animated gift can be inserted in a powerpoint show like any other graphical format ( e.g bmp, jpg, etc) To enable this: Add a new slide that can contain an image. Select the option “Insert... en.kioskea.net/faq/sujet-938-inserting-animated-gif
Formatting Your Hard DriveFormatting Your Hard Drive Formatting and installing your Hard drive using the installation CD ] A hard disk drive is a non-volatile device mainly for data storage. Usually faster than any other storage device, this essential... en.kioskea.net/faq/sujet-194-formatting-your-hard-drive

Results for The BMP format

WD My Book formattin (Solved)Hello, I bought a 1TB Western Digital My Book External Hard Drive, I need to format it to become Mac OS Extended (Journaled) but I am having a problem doing this, I keep receiving the same error message "file system verify or repair failed" It will... en.kioskea.net/forum/affich-4848-wd-my-book-formattin
Outlook issue with HTML form (Solved)Hello, I have a small website with a very simple HTML form that allows user to send his data; then the webmaster receives an email with the data included in the form. My problem is that, when ever Outlook is set up on a machine, the email button open... en.kioskea.net/forum/affich-247-outlook-issue-with-html-form
Excel Date Format (Solved)Hello, when users enter a date in excel using this format 12.1.2008, i need the cell to automatically change the format to 12-Jan-08 thanks, moses en.kioskea.net/forum/affich-19164-excel-date-format

Results for The BMP format

Download Network NotepadSimple, efficient, free:-) to simplify a small network, network notepad proves to be enough efficiency. He allows to export schemata accomplished in format BMP, GIF or else PNG. He allows furthermore to make pings, to establish connections telnet... en.kioskea.net/telecharger/telecharger-321-network-notepad
Download PaintStudio LitePaintStudio is an editor and a slide viewer of pictures. It supports several formats of pictures notably Bitmap (*.bmp), JPEG (*.jpg, *.jpeg), GIF (*.GIF), PNG-8 and 24 (*.png), TARGA (*.tga), PCX (*.pcx), Windows Icons (*.ico), Win32 Enhanced... en.kioskea.net/telecharger/telecharger-417-paintstudio-lite
Download Smartision ScreenCopysmartision ScreenCopy is a (free) free software allowing to accomplish easily captures of screen on formats JPEG or BMP. It has on top of that an interesting functionality of creation of galleries photographs in format HTML. Features Saving... en.kioskea.net/telecharger/telecharger-316-smartision-screencopy

Results for The BMP format

Formatting a hard disk Before trying to understand formatting, you first need to understand how a hard drive works. Many people do not distinguish low-level formatting (also called physical formatting) from high-level formatting (also called logical formatting). Even... en.kioskea.net/repar/format.php3
Video and digital imaging - The GIF format The GIF format (Graphic Interchange Format) is a bitmap (raster) graphic file format developed by Compuserve. There are two versions of this file format developed respectively in 1987 and 1989: GIF 87a supporting LZW compression, interlacing... en.kioskea.net/video/format-gif.php3
Video and digital imaging - The TIF format The TIF format (Tagged Image File Format) is a bitmap (raster) graphic file format. It was developed in 1987 by Aldus (now belonging to Adobe). The latest specifications (Revision 6.0) were published in 1992. The TIFF format is an old graphic... en.kioskea.net/video/format-tif.php3