When was bitmap created




















Bitmap pixels are stored as bits packed in rows where the size of each row is rounded up to a multiple of 4 bytes a bit DWORD by padding. The total amount of bytes required to store the pixels of an image can not be directly calculated by just counting the bits.

Since there is padding involved, the effect of round up the size of each row to a multiple of 4 bytes is required. Padding bytes not necessarily 0 are to be appended to the end of the rows in order to bring up the length of the rows to a multiple of four bytes. When the pixel array is loaded into memory, each row must begin at a memory address that is a multiple of 4. Pixel formats and their implications are as listed below:.

Table of Content. What is a BMP file? It can following possible values. DIB header bitmap information header The detailed information about the image is represented by this header. Availability of colour in a bitmap file varies as follow: One, 4 and 8-bit - expected to always contain a colour palette Sixteen, 24 and bit - never contain colour palettes Sixteen and bit BMP files - contain bitfields mask values in place of the colour palette Pixel Storage Bitmap pixels are stored as bits packed in rows where the size of each row is rounded up to a multiple of 4 bytes a bit DWORD by padding.

Pixel formats and their implications are as listed below: The 1-bit per pixel 1bpp format supports 2 distinct colours, for example: black and white. The 2-bit per pixel 2bpp format supports 4 distinct colours and stores 4 pixels per 1 byte, the left-most pixel being in the two most significant bits. Each pixel value is a 2-bit index into a table of up to 4 colours. The 4-bit per pixel 4bpp format supports 16 distinct colours and stores 2 pixels per 1 byte, the left-most pixel being in the more significant nibble.

A notable exception is the Microsoft Windows 3. Although the BMP RLE scheme is lossless and easily and quickly decompressed, it is not considered a superior compression method. Although the BMP format is well-defined, there is no actual format specification document published by Microsoft.

Information about structure and data encoding methods is contained in a number of programmer's references, manuals, online help facilities, and include files associated with the Microsoft Windows Software Development Kits SDKs and Microsoft Developers Network Knowledge Base. File Organization Windows 1.

There is no provision for a color palette or any other features that would make this format device-independent. Support for compression of the bitmap data is also lacking. File Header Bitmap Data Windows 2. Of these four sections, only the palette information may be optional, depending on the bit depth of the bitmap data. The BMP file header is 14 bytes in length and is nearly identical to the 1. The file header is followed by a second header called the bitmap header , a variable-sized palette, and the bitmap data.

Width and Height represent the size of the bitmap in pixels and in scan lines, respectively. ByteWidth shows the width of the bitmap in bytes. It is assumed that this value will include the size of any scan line padding that is present. Planes is the number of color planes used to store the bitmap. This value is always 1.

BitsPerPixel is the size of each pixel in bits. This value is typically 1, 4, or 8. The image data immediately follows the header and is stored in an uncompressed format. Each pixel stores an index value into the fixed system colormap used by Windows 1. The presence of scan line padding may be determined by comparing the calculated width of a line in bytes with the actual width of the line in bytes stored as the value of the ByteWidth field.

If your application reads Windows bitmap files, make sure to always check this field before attempting to use any of the data read from the file. FileSize is the total size of the BMP file in bytes and should agree with the file size reported by the filesystem.

This field only stores a useful value when the bitmap data is compressed, and this value is usually zero in uncompressed BMP files. Reserved1 and Reserved2 do not contain useful data and are usually set to zero in a BMP header written to disk.

These fields are instead used by an application when the header is read into memory. BitmapOffset is the starting offset of the bitmap data from the beginning of the file in bytes. Following the file header in v2. This header contains information specific to the bitmap data.

For Windows 2. Width and Height are the width and height of the image in pixels, respectively. If Height is a positive number, then the image is a "bottom-up" bitmap with the origin in the lower-left corner. If Height is a negative number, then the image is a "top-down" bitmap with the origin in the upper-left corner. Width does not include any scan-line boundary padding. Planes is the number of color planes used to represent the bitmap data.

BMP files contain only one color plane, so this value is always 1. BitsPerPixel is the number of bits per pixel in each plane. This value will be in the range 1 to 24; the values 1, 4, 8, and 24 are the only values considered legal by the Windows 2.

The Windows 2. Following the header is the color palette data. A color palette is always present in a BMP file if the bitmap data contains 1-, 4-, or 8-bit data.

Twenty-four-bit bitmap data never uses a color palette nor does it ever need to. The size of the color palette is calculated from the BitsPerPixel value. The color palette has 2, 16, , or 0 entries for a BitsPerPixel of 1, 4, 8, and 24, respectively. The file header is also followed by a bitmap header, which is an expanded version of the v2. For Windows 3. BitsPerPixel is the number of bits in each pixel.

This value is in the range 1 to 24; the values 1, 4, 8, and 24 are the only values considered legal by the Windows 3. Compression indicates the type of encoding method used to compress the bitmap data. SizeOfBitmap is the size of the stored bitmap in bytes. This value is typically zero when the bitmap data is uncompressed; in this case, the decoder computes the size from the image dimensions.

HorzResolution and VertResolution are the horizontal and vertical resolutions of the bitmap in pixels per meter. ColorsUsed is the number of colors present in the palette. If this value is zero, and the value of BitsPerPixel is less than 16, then the number of entries is equal to the maximum size possible for the colormap. This field is used to provide as accurate a display as possible when using graphics hardware supporting fewer colors than are defined in the image.

For example, an 8-bit image with colors might only have a dozen or so colors making up the bulk of the image. If these colors could be identified, a display adapter with only color capability would be able to display the image more accurately using the 16 most frequently occurring colors in the image.

The most important colors are always stored first in the palette; ColorsImportant is 0 if all of the colors in the palette are to be considered important. The color palette that may follow the bitmap header is basically the same as the v2. This allows palette entries to be read as 4-byte values, making these values more efficient to read in memory and easier to see in a hex dump or debugger. Reserved pads the structure to end on an even-byte boundary and is always zero.

This variation adds three additional fields that follow the bitmap header in place of a color palette. If the bitmap contains 16 or 32 bits per pixel, then only a Compression value of 3 is supported and the RedMask, GreenMask, and BlueMask fields will be present following the header in place of a color palette. If Compression is a value other than 3, then the file is identical to a Windows 3. The bits in these mask values must be contiguous and must not contain overlapping fields.

Each bitmap file contains: a bitmap-file header: this contains information about the type, size, and layout of a device-independent bitmap file. The color table is not present for bitmaps with 24 color bits because each pixel is represented by bit red-green-blue RGB values in the actual bitmap data area. Each scan line consists of consecutive bytes representing the pixels in the scan line, in left-to-right order. The file can be: 1-bit: 2 colors monochrome 4-bit: 16 colors 8-bit: colors.

The default filename extension of a Windows DIB file is. Please update.



0コメント

  • 1000 / 1000