0% found this document useful (0 votes)
18 views

BMP

The document provides details about the BMP file format structure including the header, color table, pixel array, and optional components. It describes the key fields in the bitmap file header and DIB header, and notes several DIB header variants supporting additional features.

Uploaded by

ravi.23phd7208
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

BMP

The document provides details about the BMP file format structure including the header, color table, pixel array, and optional components. It describes the key fields in the bitmap file header and DIB header, and notes several DIB header variants supporting additional features.

Uploaded by

ravi.23phd7208
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

The BMP file format, also known as Bitmap Image File or Device Independent Bitmap (DIB) file

format, is a raster graphics image file format used to store bitmap digital images. Here is a
breakdown of the BMP file structure:

Header: This consists of two parts:

Bitmap File Header: Contains general information about the bitmap image file. It includes fields like
the file type, file size, and offset where the pixel array (bitmap data) can be found.

DIB Header (Bitmap Information Header): Provides detailed information about the image, such as the
dimensions, color format, number of color planes, bits per pixel, compression method (if any), the
size of the raw bitmap data, horizontal and vertical resolution, number of colors, and important
colors used.

Color Table (optional): If the bitmap uses a color palette, this table contains the definition of colors
used by the bitmap in indexed mode. This is necessary for bitmaps with less than 24 bits per pixel.

Pixel Array (Bitmap Data): Contains the actual pixel values representing the image. The arrangement
of pixel data depends on the number of bits per pixel and any compression. Each row in the pixel
array is padded to a multiple of 4 bytes (a requirement of the BMP format).

Gap1 and Gap2 (optional): These are optional gaps that might exist in some BMP files for alignment
purposes.

ICC Color Profile (optional): Some BMP files might include an ICC color profile to manage the colors
more accurately.

Detailed Header Information:

File Type: Always "BM" for Bitmap files.

File Size: Total size of the BMP file in bytes.

Reserved Fields: Usually set to zero; reserved for future use.

Data Offset: Offset from the beginning of the file to the bitmap data.

DIB Header Variants:

There are several variants of the DIB header, including:

BITMAPCOREHEADER (OS/2 BMP format)

BITMAPINFOHEADER: The most common DIB header used in Windows BMP files.
BITMAPV4HEADER: Introduces support for ICC profiles and color space type fields.

BITMAPV5HEADER: Adds support for additional color space information.

Each header variant supports additional features and is designed to be backward compatible with
the simpler headers.

BMP files are widely supported due to their simplicity and wide compatibility, although they may not
be the most efficient format in terms of file size and compression capabilities compared to more
modern formats like JPEG or PNG.

User

how much memory is required to read and process a bmp file with full hd resolution?

ChatGPT

To determine the memory required to read and process a full HD resolution BMP file (1920x1080
pixels), you need to consider several factors:

Bits per Pixel (bpp): This value indicates how many bits are used to represent each pixel. Common
values are 24 (for true color) and 32 (for true color with alpha channel).

Image Dimensions: The dimensions of a full HD image are 1920 pixels (width) x 1080 pixels (height).

Row Padding: BMP rows are aligned on 4-byte boundaries. The padding for each row can be
calculated based on the width and bits per pixel, ensuring each row ends on a 4-byte boundary.

Here’s how to calculate the memory required:

Step 1: Calculate Bytes per Row

Bytes per row

Width

Bits per Pixel

8
×

Bytes per row=⌈

8×4

Width×Bits per Pixel

⌉×4

Where


⌈x⌉ denotes the ceiling function which rounds up to the nearest multiple of 4.

Step 2: Calculate Total Image Size

Total Image Size

Bytes per row

Height

Total Image Size=Bytes per row×Height

Example Calculation for 24-bpp BMP File:

Let's calculate this for a 24-bit BMP file (which is very common for BMP files):

Width: 1920 pixels

Height: 1080 pixels

Bits per Pixel: 24 bits

You might also like