Format reference · .bmp .dib

What is a BMP file?

BMP is the Windows bitmap format: a simple file that usually stores pixels with no compression at all. It is easy for software to read and write, but files are huge compared with PNG or JPG, so BMP is rarely the right format to share or publish.

Origin

BMP grew out of the bitmap formats used by early Windows and OS/2, and its common form, the device-independent bitmap, became standard with Windows 3.0 in 1990. Later header versions added color-space information and channel masks, including room for an alpha channel. Paint still opens and saves BMP, which is why it shows up on so many Windows machines.

How a BMP stores pixels

A BMP file is a small header followed by raw pixel rows. For historical reasons, rows are usually stored from the bottom of the image up, colors are in blue-green-red order, and each row is padded to a multiple of 4 bytes. There is no prediction or transform as in other formats; what you see is close to what is in memory.

Images with 1, 4 or 8 bits per pixel use a color palette, and those can be compressed with a simple run-length encoding (RLE) that shrinks long rows of identical pixels. Most BMPs, however, are 24-bit or 32-bit and completely uncompressed. BMP is lossless in either case: nothing is approximated.

Transparency and animation

Classic 24-bit BMPs have no transparency. Newer 32-bit variants can include an alpha channel, but programs disagree on whether to honor it; some show the image as fully opaque, others ignore the fourth byte entirely. If transparency matters, use PNG. BMP has no animation support.

Why BMP files are so large

Without compression, size is simply width × height × bytes per pixel. A 24-bit 1920×1080 image is about 6.2 MB; a 12-megapixel photo is about 36 MB. The same photo as a high-quality JPG is typically a few megabytes, and a screenshot saved as PNG is often a small fraction of its BMP size with identical pixels.

BMP still turns up as output from older Windows software, some scanners and industrial or scientific cameras, and in embedded projects where a microcontroller needs to read pixels without a decoder.

Support and conversion

Windows and macOS open BMP natively, and current browsers display it. Many websites, email providers and upload forms reject it because of its size. BMP to PNG keeps every pixel exactly and is the right choice for screenshots and graphics. BMP to JPG gives the smallest files for photos.

Use BMP for

  • Feeding pixels to simple programs or microcontrollers without a decoder
  • Legacy Windows software that only reads BMP
  • Temporary intermediate files in technical workflows

Avoid BMP for

  • Sharing by email or messaging, because files are very large
  • Websites and online forms
  • Images that need reliable transparency
  • Long-term storage, where lossless PNG is smaller with the same pixels

BMP questions

Is BMP better quality than JPG?

A BMP stores pixels exactly, so it has no compression artifacts, while JPG approximates detail. But PNG is also exact and much smaller, so there is rarely a reason to keep BMP. Converting BMP to PNG loses nothing.

Why is my BMP file so big?

Most BMPs are uncompressed, so every pixel costs 3 or 4 bytes. A full HD image is about 6 MB and a 12-megapixel photo about 36 MB. Converting to PNG shrinks it without any loss; converting to JPG shrinks it further for photos.

Can BMP files have a transparent background?

Only 32-bit BMPs can carry an alpha channel, and support is inconsistent, so many programs show those pixels as solid. For dependable transparency, convert the image to PNG, which every browser and editor handles the same way.

Can I use BMP images on a website?

Browsers can display them, but you shouldn’t. A BMP can be tens of times larger than the same image as PNG, JPG or WebP, which makes pages slow. Convert to PNG for graphics or JPG and WebP for photos before publishing.

Tools for BMP files

Other formats