Jump to content

Bitmap: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Reverted edits by 195.195.248.251 (talk) to last version by Tango
Line 22: Line 22:


{{main|BMP file format}}
{{main|BMP file format}}
bitmaps are poo, i preffer the gloo's

Microsoft 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:<ref name=DIBhelp>{{cite web | url = http://support.microsoft.com/kb/q81498/ | title = DIBs and Their Uses | work = Microsoft Help and Support | date = 2005-02-11}}</ref>
Microsoft 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:<ref name=DIBhelp>{{cite web | url = http://support.microsoft.com/kb/q81498/ | title = DIBs and Their Uses | work = Microsoft Help and Support | date = 2005-02-11}}</ref>



Revision as of 11:49, 24 January 2008

Template:Two other uses

In computer graphics, a bitmap or pixmap is a type of memory organization or image file format used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped array of bits. Now, along with pixmap, it commonly refers to the similar concept of a spatially mapped array of pixels. Raster images in general may be referred to as bitmaps or pixmaps, whether synthetic or photographic, in files or in memory.

In some contexts, the term bitmap implies one bit per pixel, while pixmap is used for images with multiple bits per pixel.[1][2]

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 .BMP (or .DIB for device-independent bitmap). Besides BMP, other file formats that store literal bitmaps include InterLeaved Bitmap (ILBM), Portable Bitmap (PBM), X Bitmap (XBM), and Wireless Application Protocol Bitmap (WBMP). Most other image file formats, such as JPEG, TIFF, PNG, and GIF, to name just a few, store bitmap images (as opposed to vector images), but they are not usually referred to as bitmaps, since they use compressed formats internally.

Pixel storage

In 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 (n is the bit depth, since 1 byte equals 8 bits).

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:

, where height and width are given in pixels.

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 format

bitmaps are poo, i preffer the gloo's Microsoft 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]

A device-independent bitmap (DIB) is a format used to define device-independent bitmaps in various color resolutions. The main purpose of DIBs is to allow bitmaps to be moved from one device to another (hence, the device-independent part of the name). A DIB is an external format, in contrast to a device-dependent bitmap, which appears in the system as a bitmap object (created by an application...). A DIB is normally transported in metafiles (usually using the StretchDIBits() function), BMP files, and the Clipboard (CF_DIB data format).

Here, "device independent" refers to the format, or storage arrangement, and should not be confused with device-independent color.

Other bitmap file formats

The 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 also

References

  1. ^ James D. Foley (1995). Computer Graphics: Principles and Practice. Addison-Wesley Professional. pp. p.13. ISBN 0201848406. The term bitmap, strictly speaking, applies only to 1-bit-per-pixel bilevel systems; for multiple-bit-per-pixel systems, we use the more general term pixmap (short for pixel map). {{cite book}}: |pages= has extra text (help)
  2. ^ V.K. Pachghare (2005). Comprehensive Computer Graphics: Including C++. Laxmi Publications. pp. p.93. ISBN 8170081858. {{cite book}}: |pages= has extra text (help)
  3. ^ Julian Smart, Stefan Csomor, and Kevin Hock (2006). Cross-Platform GUI Programming with Wxwidgets. Prentice Hall. ISBN 0131473816.{{cite book}}: CS1 maint: multiple names: authors list (link)
  4. ^ "DIBs and Their Uses". Microsoft Help and Support. 2005-02-11.
  5. ^ "List of bitmap file types". Search File-Extensions.org.
  6. ^ J. Thomas, A. Jones (2006). Communicating Science Effectively: a practical handbook for integrating visual elements. IWA Publishing. ISBN 1843391252.