Bitmap: Difference between revisions

Content deleted Content added
GreenC bot (talk | contribs)
Reformat 2 URLs (Wayback Medic 2.5)
Thashley (talk | contribs)
Streamlined text
Line 10:
A bitmap is a type of [[computer storage|memory]] organization or [[image file format]] used to store [[digital image]]s. The term ''bitmap'' comes from the [[computer programming]] terminology, meaning just a ''map of bits'', a spatially mapped [[bit array|array of bits]]. Now, along with ''pixmap'', it commonly refers to the similar concept of a spatially mapped array of pixels. [[Raster graphics|Raster]] images in general may be referred to as bitmaps or pixmaps, whether synthetic or photographic, in files or memory.
 
Many [[graphical user interface]]s use bitmaps in their built-in graphics subsystems;.<ref>{{cite book |title= Cross-Platform GUI Programming with Wxwidgets |author1=Julian Smart |author2=Stefan Csomor |author3=Kevin Hock |name-list-style=amp |url= https://books.google.com/books?id=CyMsvtgnq0QC&q=bitmap+pixmap+gui&pg=PA265 |publisher= Prentice Hall |year= 2006 |isbn= 0-13-147381-6}}</ref> forFor example, the [[Microsoft Windows]] and [[OS/2]] platforms' [[Graphics Device Interface|GDI]] subsystem, where the specific format used isuses the ''Windows and OS/2 bitmap file format'', usually named with the [[file extension]] of <code>.BMP</code> (or <code>.DIB</code> for ''device-independent bitmap''). Besides [[BMP file format|BMP]], other file formats that store literal bitmaps include [[ILBM|InterLeaved Bitmap (ILBM)]], [[Portable pixmap|Portable Bitmap (PBM)]], [[X BitMap|X Bitmap (XBM)]], and [[Wireless Application Protocol Bitmap Format|Wireless Application Protocol Bitmap (WBMP)]]<!-- please keep this list short; detailed list should be below -->. Similarly, most other image file formats, such as [[JPEG]], [[TIFF]], [[Portable Network Graphics|PNG]], and GIF, also store bitmap images (as opposed to [[vector graphics]]), but they are not usually referred to as ''bitmaps'', since they use [[Image compression|compressed]] formats internally.
 
==Pixel storage==
In typical [[image compression|uncompressed]] bitmaps, image [[pixel]]s are generally stored with a variable number of bits per pixel which identify its color, (the [[color depth|color depth)]]. Pixels of 8 bits and fewer can represent either [[grayscale]] or [[indexed color]]. An [[alpha channel]] (for [[transparency (graphic)|transparency]]) may be stored in a separate bitmap, where it is similar to a grayscale 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, a lower bound on storage size for a n-bit-per-pixel (2<sup>n</sup> colors) bitmap, in [[byte]]s, can be calculated as:
:<math>\text{size} = \text{width} \cdot \text{height} \cdot n/8</math>
where width and height are given in pixels.
 
In the formula above, header size and [[Palette (computing)|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 (computer architecture)|word]], additional bytes may be needed.
 
==Device-independent bitmaps and BMP file format==
{{Main|BMP file format}}
 
Microsoft has defined a particular representation of color bitmaps of different [[color depth]]s, as an aid to exchanging bitmaps between devices and applications with a variety of internal representations. They called these device-independent bitmaps as "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>
 
<blockquote>
Line 38:
 
The [[X Window System]] uses a similar [[X Bitmap|XBM]] format for [[black-and-white]] images, and [[X PixMap|XPM]] (''pixelmap'') for color images. Numerous other uncompressed bitmap file formats are in use, though most not widely.<ref>{{cite web |url= http://www.file-extensions.org/filetype/extensions/name/Bitmap+image/
|title= List of bitmap file types |work= File-Extensions.org}}</ref> For most purposes, standardized compressed bitmap files such as [[GIF]], [[Portable Network Graphics|PNG]], [[TIFF]], and [[JPEG]] are used;. [[losslessLossless compression]] in particular provides the same information as a bitmap in a smaller file size.<ref>{{cite book |title= Communicating Science Effectively: a practical handbook for integrating visual elements |author1=J. Thomas |author2=A. Jones |publisher= IWA Publishing |year= 2006 |isbn= 1-84339-125-2 |url= https://books.google.com/books?id=xrgkojGgwDYC&q=gif+png+tiff+jpeg+common&pg=PA26}}</ref> TIFF and JPEG have various options. JPEG is usually [[lossy compression]]. TIFF is usually either uncompressed, or lossless [[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;. suchSuch raw files are just bitmaps in files, often with no header or size information (they are distinct from photographic [[raw image format]]s, which store raw unprocessed sensor data in a structured container such as [[TIFF]] format along with extensive image [[metadata]]).
 
==See also==