Information AboutBitmap |
| CATEGORIES ABOUT BITMAP IMAGE | |
| graphics file formats | |
| windows multimedia | |
In Computing , the Bitmap Image format is an Image File Format used for representing Raster Graphics on various Operating System s. The Microsoft Windows and OS/2 platforms use bitmaps in their underlying graphics Subsystem ( GDI ), with the File Extension .BMP (or .DIB for ''device-independent bitmap''). Images are generally stored with a Color Depth of 2 (1-bit), 16 (4-bit), 256 (8-bit), 65,536 (16-bit), or 16.7 Million (24-bit) colors (the bits represent the bits per pixel). 8-bit images can also be greyscale instead of Indexed Color . An Alpha Channel (for Transparency ) may be stored in a separate file, where it is similar to a Greyscale image. A 32-bit version with integrated alpha channel has been introduced with Windows XP and is used within its logon and theme system; it has yet to gain wide support in image editing software but has been supported in Adobe Photoshop since version 7 and Adobe Flash since version MX 2004 (then known as Macromedia Flash). STORAGE ALGORITHM BMP files are usually not , which occupies about 287.65 KB in the PNG format, takes about 3281.5 KB as a 24-bit BMP file. As such, BMPs are generally unsuitable for transferring images on the Internet or other slow or capacity-limited Media . Depending on the color depth, a pixel in the picture will be stored using one or more bytes, which is determined by n/8 (n is the bit depth, since 1 byte equals 8 bits). The color of the pixel will be calculated (by the picture viewer, for example) based on the value of the bytes and the corresponding values read from the color palette. For more detailed information, see the section of bitmap file format below. The approximate size for a n-bit (2n colors) bitmap in Byte s can be calculated as: size of BMP file , where height and width are given in Pixels . In the formula above, 54 is the size of the Header of the bitmap file. And is the size of the color Palette . Notice that this is an approximation, as for an n-bit bitmap image, although there can be maximum colors, a specific image may not use all of these colors. Since the color palette only defines the colors that are used by the image, the actual size of the color palette will be smaller than . Also, only 8-bit (or less) bitmaps use a palette. For 16-bit (or higher) bitmaps, omit the palette part from the size calculation: size of BMP file Due to effects of ''dword padding'' (if the number of bytes matching a horizontal line in the image does not form multiple Dword s, i.e. divisible by 4, null bytes are added), the term describing the raw image size is approximated and the calculated size will be slightly different from the actual file size. For detailed information, see the sections on file format below. TYPICAL FILE FORMAT A typical bitmap file usually contains the following blocks of data: The following sections discuss the data stored in the bitmap file in details. Notice that this is the standard bitmap file format. Some bitmap images may be stored using a slightly different format, depending on the application that creates it. Also, not all fields are used; a value of 0 will be found in these unused fields. Bitmap header This block of bytes is added before the bitmap format used internally by GDI and serves for identification. A typical application will read this block first to ensure that the file is actually a bitmap file and that it is not damaged. Bitmap information This block of bytes tells the application detailed information about the image, which will be used to display the image on the screen. It also matches the header used internally by Windows and OS/2 and thus has several different variants. All of them start with a Dword field, specifying their size in bytes, so that an application can easily determine the exact format used. The new header variants were introduced with new versions of Windows and OS/2, adding more functionality to the GDI. But since these extended headers are used only with few GDI functions, for compatibility with older programs most applications use the older headers when saving files. With OS/2 being obsolete, for now the only common format is the Windows 3.0 V3 header. See the table below for more information about the variants. The V3 header: The compression method field (bytes #30-33) can have the following values:The image size field can be 0 for BI_RGB bitmaps. The OS/2 V1 header is also popular:The OS/2 V1 bitmaps cannot be compressed and cannot be 16 or 32 bits/pixel. Color palette This block of bytes define the colors being used inside an indexed-color image. As stated above, the bitmap picture will be stored pixel by pixel. Each pixel is described by a value which will be stored using one or more bytes. Therefore, the purpose of the color palette in indexed-color bitmaps is to tell the application the actual color that each of these values corresponds to. A typical bitmap file uses the RGB color model. In this model, a color is created by mixing different intensities (which can vary from 0 to 255) of red (R), green (G) and blue (B). A color is thus defined using the 3 values for R, G and B. In the bitmap file implementation, the color palette contains many entries; the number of entries is the number of colors used in the picture. Each entry contains 4 bytes for a Windows bitmap and 3 bytes for an OS/2 bitmap. The first (and only for OS/2) 3 bytes store the values for blue, green and red respectively while the last one is unused and is filled with 0 by most applications. For each byte, a value of 0 indicates that the corresponding color (either red, green, or blue) is not used to create the current image color. On the other hand, a value of 255 indicates that maximum intensity is used. As mentioned above, the color palette is not used when the bitmap is 16-bit or higher. Bitmap data This block of bytes describes the image, pixel by pixel. Pixels are stored starting in the bottom left corner going from left to right and then row by row from the bottom to the top. Each pixel is described using one or more bytes. If the number of bytes matching a horizontal line in the image is not divisible by 4, the line is padded with Null-bytes . MISCELLANEOUS The simplicity of BMP and its widespread familiarity in MS Windows and elsewhere, as well as the fact that this format is well- Documented and free of Patent s, makes it a very common format that image processing programs from many operating systems can read and write. While bitmap images have a relatively large file size, most bitmap files compress very well with Lossless Data Compression algorithms such as ZIP because they contain redundant data. RELATED FORMATS The X Window System uses a similar XBM format for Black-and-white images, and XPM (''pixelmap'') for Color images. There are also a variety of RAW Format s, which saves raw Data with no other Information . The Portable Pixmap File Format (.PPM) and Truevision TGA (.TGA) formats also exist, but are less often used - or only for special purposes. for example, tga can contain transparency information. Yet other formats store as "bitmaps" (as opposed to Vector Graphics ), but use compression or color indices, and thus are not strictly considered true bitmaps. SEE ALSO NOTES EXTERNAL LINKS
|
|
|