Flux rss
Bookmark Bookmark & Share
Il formato BMP O formato BMP BMP-Format Le format BMP El formato BMP

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.
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
HTML forms Forms Interactive forms let web page authors give their pages interactive elements, such as for receiving messages from their readers, much like the reply cards found in some magazines. The reader enters information by filling in fields or clicking... en.kioskea.net/contents/html/htmlform.php3
Spreadsheet - Formulas Introduction to Formulas The main use of a spreadsheet is to automate calculations, which means using cells to perform operations based on values in other cells. The spreadsheet recalculates all the values each time a change is made to the value of... en.kioskea.net/contents/tableur/tabformules.php3
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
How to convert a video clip in .flv format and vice versaIntroduction Here's a tip for you to simply convert a video clip of (almost) any format to .flv format. This trick will be useful for dealing with the video post or publish your video on the web. How to convert to and from the .flv... en.kioskea.net/faq/sujet-447-how-to-convert-a-video-clip-in-flv-format-and-vice-versa
Formatting your drive with Fat32Formatting your drive with Fat32 Windows XP normally refuse to format a partition higher than 40 GB with FAT32. however this operation performs properly with NTFS The solution for this issue is to boot your installation CD and use... en.kioskea.net/faq/sujet-676-formatting-your-drive-with-fat32
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
Download HP USB Disk Storage Format ToolHP USB Disk Storage Format Tool is a small utility allowing to format a key USB or READER MP4. It also allows to make a key (Bootable). This software works with all keys and readers MP4 of the market. To make work this utility under Windows... en.kioskea.net/telecharger/telecharger-127-hp-usb-disk-storage-format-tool
Download HDD Low Level Format ToolIt is administrator's free application of hard disk. It is quick and easy to use. He allows to format and of partition discs including flash.It supports discs: SATA, IDE, S-ATA (SATA), IDE (E-IDE), SCSI, USB, FIREWIRE, LBA-48 and even the external... en.kioskea.net/telecharger/telecharger-815-hdd-low-level-format-tool
Download Format FactoryFormat Factory is an application that allows conversion of various types of media files. It has various characteristics that allow you to customize a lot of stuff like: Convert video formats, audio and picture shows. Repair damaged files. Reduce... en.kioskea.net/telecharger/telecharger-3532-format-factory
Pantone PANTONE Formula Guide Coated/Uncoated/MatteDesigners Formula Guide. Basic tools for accurate selection, specification and matching of solid PANTONEî colours. Eliminate guesswork with this industry standard. Three-guide set on coated, uncoated and matt stock. Includes 1, 114 solid PANTONEî... en.kioskea.net/guide/578343190-pantone-pantone-formula-guide-coated-uncoated-matte
MKV format (Matroska Video)MKV format The MKV format (Matroska Video) is an entirely free video format. More precisely, it is a container (hence the name Matroska, in reference to the Russian dolls contained within another) making it possible to contain video (DivX, Xvid,... en.kioskea.net/contents/video/mkv-matroska.php3
S/PDIF formatS/PDIF format The S/PDIF standard ("Sony/Philips Digital Interface", or SPDIF for short) is a digital audio data transfer format. It is an international standard known as "IEC-958 type II", which defines both hardware specifications (physical... en.kioskea.net/contents/audio/spdif-s-pdif.php3
Formatting - Formatting a hard driveBefore 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/contents/repar/format.php3