|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
This article is about the storage organization of raster images. For bitmapped graphics in general, see raster graphics. For DIB/BMP bitmap file format, see BMP file format. For general bit-addressed data structures, see bit array. For the musician, see Bitmap (group).
In some contexts, the term bitmap implies one bit per pixel, while pixmap is used for images with multiple bits per pixel.12 Many graphical user interfaces use bitmaps in their built-in graphics subsystems;3 for example, the Microsoft Windows and OS/2 platforms' GDI subsystem, where the specific format used is the Windows and OS/2 bitmap file format, usually named with the file extension of
Pixel storageIn typical uncompressed bitmaps, image pixels are generally stored with a color depth of 1, 4, 8, 16, 24, 32, 48, or 64 bits per pixel. Pixels of 8 bits and fewer can represent either grayscale or indexed color. An alpha channel (for transparency) may be stored in a separate bitmap, where it is similar to a greyscale bitmap, or in a fourth channel that, for example, converts 24-bit images to 32 bits per pixel. The bits representing the bitmap pixels may be packed or unpacked (spaced out to byte or word boundaries), depending on the format or device requirements. Depending on the color depth, a pixel in the picture will occupy at least n/8 bytes, where n is the bit depth. For an uncompressed, packed within rows, bitmap, such as is stored in Microsoft DIB or BMP file format, or in uncompressed TIFF format, the approximate size for a n-bit-per-pixel (2n colors) bitmap, in bytes, can be calculated as:
In the formula above, header size and color palette size, if any, are not included. Due to effects of row padding to align each row start to a storage unit boundary such as a word, additional bytes may be needed. Device-independent bitmaps and BMP file formatMicrosoft has defined a particular representation of color bitmaps of different color depths, as an aid to exchanging bitmaps between devices and applications with a variety of internal representations. They called these device-independent bitmaps or DIBs, and the file format for them is called DIB file format or BMP file format. According to Microsoft support:4
Here, "device independent" refers to the format, or storage arrangement, and should not be confused with device-independent color. Other bitmap file formatsThe X Window System uses a similar XBM format for black-and-white images, and XPM (pixelmap) for color images. Numerous other uncompressed bitmap file formats are in use, though most not widely.5 Much more common are the standardized compressed bitmap files such as GIF, PNG, TIFF, and JPEG.6 TIFF and JPEG have various options. JPEG is usually lossy compression. TIFF is usually either uncompressed, or losslessly Lempel-Ziv-Welch compressed like GIF. PNG uses deflate lossless compression, another Lempel-Ziv variant. There are also a variety of "raw" image files, which store raw bitmaps with no other information; such raw files are just bitmaps in files, often with no header or size information, and should not be confused with photographic raw image formats, which store raw unprocessed sensor data in a structured container such as TIFF format along with extensive image metadata. See alsoReferences
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| All Right Reserved © 2007, Designed by Stylish Blog. |