File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Images
  • Raster
  • Vector
  • Camera raw
  • Layered projects
  • HDR & scientific
  • Icons
  • Retro
  1. Home
  2. Images
  3. Raster
  4. BMP
.BMP
  • Overview
  • Windows bitmap (BM)
    • File header
    • DIB header
    • Colour spaces
    • Colour table
    • Bit masks
    • Pixel data
    • Compression
  • OS/2 bitmap array (BA)
  • OS/2 icon (IC)
  • OS/2 colour icon (CI)
  • OS/2 pointer (PT)
  • OS/2 colour pointer (CP)

.BMP

Windows and OS/2 bitmaps

Introduction

BMP is the bitmap image format that Microsoft and IBM shared in Windows and OS/2 in the late 1980s. A BMP file holds a device independent bitmap (DIB): a header describing the image, an optional palette and the pixels, usually uncompressed. It begins with a 14-byte file header whose first two bytes are a type code.

Windows only ever writes the type BM, and almost every .bmp file is one of those. OS/2’s Presentation Manager reused the same header for its icons, mouse pointers and collections of bitmaps, giving each a type code of its own. These files are built from the same parts as a BM bitmap, but are put together differently, so each has its own page here.

Variations

Windows bitmap (BM)

The ordinary bitmap, written by Windows, OS/2 and nearly every image program. A file header is followed by a DIB header, an optional colour table or set of bit masks, and the rows of pixels, bottom row first. The DIB header has grown over the years, from 12 bytes in Windows 2.0 and OS/2 1.x to 124 bytes in Windows 98, and its first four bytes give its size and so its version.

The file starts with BM (42 4D). The four bytes at offset 14 hold the DIB header size: 12, 16 to 64, 108 or 124.

OS/2 bitmap array (BA)

A chain of bitmaps in one file, each made for a different screen. OS/2 used it so one icon, pointer or picture could carry versions for low and high resolution displays, and let the system pick the best fit. Each entry is an array header followed by a complete bitmap, icon or pointer.

The file starts with BA (42 41). At offset 14 a second type code begins the first entry’s own file header, usually BM, IC, CI, PT or CP. These files may be named .bmp, .ico or .ptr.

OS/2 icon (IC)

A black and white OS/2 icon. It is a single 1-bit bitmap twice the icon’s height, holding two masks one above the other: together they make each pixel black, white, transparent or the inverse of what is behind it.

The file starts with IC (49 43), and the bitmap’s height is twice its width. It is usually named .ico, which on Windows means a different format.

OS/2 colour icon (CI)

A colour OS/2 icon. It holds two bitmaps one after the other: the same 1-bit pair of masks as a black and white icon, then a colour image that fills in the visible pixels.

The file starts with CI (43 49), and a second CI file header follows the first bitmap’s headers and palette. It is usually named .ico.

OS/2 pointer (PT)

A black and white OS/2 mouse pointer. It is laid out exactly like a black and white icon; the two fields that are reserved in a bitmap give the hotspot, the pixel that marks where the pointer points.

The file starts with PT (50 54) and is usually named .ptr.

OS/2 colour pointer (CP)

A colour OS/2 mouse pointer. It is laid out exactly like a colour icon, with the hotspot in the file header.

The file starts with CP (43 50), followed later by a second CP file header for the colour image. It is usually named .ptr.

Also used for

  • Windows icon .ico
© 2026 fileformats.org About Contact Made by Lewpen