# Bitmap

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Bitmap
> Markdown URL: https://mediated.wiki/source/Bitmap.md
> Source: https://en.wikipedia.org/wiki/Bitmap
> Source revision: 1346668067
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

For other uses, see [Bitmap (disambiguation)](/source/Bitmap_(disambiguation)).

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Bitmap" – news · newspapers · books · scholar · JSTOR (April 2024) (Learn how and when to remove this message)

Computing term

In [computing](/source/Computing), a **bitmap** (also called **raster**) graphic is an image formed from rows of different colored [pixels](/source/Pixel).[1] A [GIF](/source/GIF) is an example of a graphics image file that uses a bitmap.[2]

As a noun, the term "bitmap" is very often used to refer to a particular bitmapping application: the **pix-map**, which refers to a map of [pixels](/source/Pixel), where each pixel may store more than two colors, thus using more than one bit per pixel. In such a case, the domain in question is the array of pixels which constitute a digital graphic output device (a screen or monitor). In some contexts, the term *bitmap* implies one bit per pixel, whereas *pixmap* is used for images with multiple bits per pixel.[3][4]

A bitmap is a type of [memory](/source/Computer_storage) organization or [image file format](/source/Image_file_format) used to store [digital images](/source/Digital_image). The term *bitmap* comes from the [computer programming](/source/Computer_programming) terminology, meaning just a *map of bits*, a spatially mapped [array of bits](/source/Bit_array). Now, along with *pixmap*, it commonly refers to the similar concept of a spatially mapped array of pixels. [Raster](/source/Raster_graphics) images in general may be referred to as bitmaps or pixmaps, whether synthetic or photographic, in files or memory.

Many [graphical user interfaces](/source/Graphical_user_interface) use bitmaps in their built-in graphics subsystems.[5] For example, the [Microsoft Windows](/source/Microsoft_Windows) and [OS/2](/source/OS%2F2) platforms' [GDI](/source/Graphics_Device_Interface) subsystem uses the *Windows and OS/2 bitmap file format*, usually named with the [file extension](/source/File_extension) .BMP (or .DIB for *device-independent bitmap*). Besides [BMP](/source/BMP_file_format), other file formats that store literal bitmaps include [InterLeaved Bitmap (ILBM)](/source/ILBM), [Portable Bitmap (PBM)](/source/Portable_pixmap), [X Bitmap (XBM)](/source/X_BitMap), and [Wireless Application Protocol Bitmap (WBMP)](/source/Wireless_Application_Protocol_Bitmap_Format). Similarly, most other image file formats, such as [JPEG](/source/JPEG), [TIFF](/source/TIFF), [PNG](/source/Portable_Network_Graphics), and GIF, also store bitmap images (as opposed to [vector graphics](/source/Vector_graphics)), but they are not usually referred to as *bitmaps*, since they use [compressed](/source/Image_compression) formats internally.

## Pixel storage

In typical [uncompressed](/source/Image_compression) bitmaps, image [pixels](/source/Pixel) are generally stored with a variable number of bits per pixel which identify its color (the [color depth](/source/Color_depth)). Pixels of 8 bits and fewer can represent either [grayscale](/source/Grayscale) or [indexed color](/source/Indexed_color). An [alpha channel](/source/Alpha_channel) (for [transparency](/source/Transparency_(graphic))) 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](/source/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](/source/BMP_file_format), or in uncompressed [TIFF](/source/TIFF) format, a lower bound on storage size for a *n*-bit-per-pixel (2n colors) bitmap, in [bytes](/source/Byte), can be calculated as:

- size = width ⋅ height ⋅ n / 8 {\displaystyle {\text{size}}={\text{width}}\cdot {\text{height}}\cdot n/8}

where width and height are given in pixels.

In the formula above, header size and [color palette](/source/Palette_(computing)) 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](/source/Word_(computer_architecture)), additional bytes may be needed.

## Device-independent bitmaps and BMP file format

Main article: [BMP file format](/source/BMP_file_format)

[Microsoft](/source/Microsoft) has defined a particular representation of color bitmaps of different [color depths](/source/Color_depth), as an aid to exchanging bitmaps between devices and applications with a variety of internal representations. They called these device-independent bitmaps "DIBs", and the file format for them is called DIB file format or [BMP file format](/source/BMP_file_format). According to Microsoft support:[6]

A device-independent bitmap (DIB) is a format used to define device-independent bitmaps in various [color resolutions](/source/Color_resolution). 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](/source/Color_management).

### Other bitmap file formats

Main article: [Image file formats](/source/Image_file_formats)

The [X Window System](/source/X_Window_System) uses a similar [XBM](/source/X_Bitmap) format for [black-and-white](/source/Black-and-white) images, and [XPM](/source/X_PixMap) (*pixelmap*) for color images. Numerous other uncompressed bitmap file formats are in use, though most not widely.[7] For most purposes, standardized compressed bitmap files such as [GIF](/source/GIF), [PNG](/source/Portable_Network_Graphics), [TIFF](/source/TIFF), and [JPEG](/source/JPEG) are used. [Lossless compression](/source/Lossless_compression) in particular provides the same information as a bitmap in a smaller file size.[8] TIFF and JPEG have various options. JPEG is usually [lossy compression](/source/Lossy_compression). TIFF is usually either uncompressed, or lossless [Lempel–Ziv–Welch](/source/Lempel%E2%80%93Ziv%E2%80%93Welch) compressed like [GIF](/source/GIF). PNG uses [deflate](/source/Deflate) lossless compression, another [Lempel-Ziv](/source/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 (they are distinct from photographic [raw image formats](/source/Raw_image_format), which store raw unprocessed sensor data in a structured container such as [TIFF](/source/TIFF) format along with extensive image [metadata](/source/Metadata)).

## See also

- [Free space bitmap](/source/Free_space_bitmap), an array of bits that tracks which disk storage blocks are in-use

- [Raster graphics](/source/Raster_graphics)

- [Raster scan](/source/Raster_scan)

- [Rasterization](/source/Rasterization)

- [Sprite (computer graphics)](/source/Sprite_(computer_graphics))

- [Voxels](/source/Voxels)

- [Vector graphics](/source/Vector_graphics)

- [Image tracing](/source/Image_tracing)

## References

1. **[^](#cite_ref-1)** ["ARCHIVED: What are bitmap and vector graphics, and how are they different"](https://kb.iu.edu/d/afmr). University Information Technology Servivces. September 22, 2023. Retrieved April 21, 2024.{{[cite web](https://en.wikipedia.org/wiki/Template:Cite_web)}}: CS1 maint: deprecated archival service ([link](https://en.wikipedia.org/wiki/Category:CS1_maint:_deprecated_archival_service))

1. **[^](#cite_ref-2)** Gregersen, Erik (January 26, 2022). ["bitmap"](https://www.britannica.com/technology/bitmap). *[Encyclopædia Britannica](/source/Encyclop%C3%A6dia_Britannica)*. Retrieved April 21, 2024.{{[cite encyclopedia](https://en.wikipedia.org/wiki/Template:Cite_encyclopedia)}}: CS1 maint: deprecated archival service ([link](https://en.wikipedia.org/wiki/Category:CS1_maint:_deprecated_archival_service))

1. **[^](#cite_ref-3)** James D. Foley (1995). [*Computer Graphics: Principles and Practice*](https://books.google.com/books?id=A4k29b0BdVMC&q=bitmap+pix+map+%22short+for+pixel+map%22&pg=PA13). Addison-Wesley Professional. p. 13. [ISBN](/source/ISBN_(identifier)) [0-201-84840-6](https://en.wikipedia.org/wiki/Special:BookSources/0-201-84840-6). 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 pix-map (short for pixel map).

1. **[^](#cite_ref-4)** V.K. Pachghare (2005). [*Comprehensive Computer Graphics: Including C++*](https://books.google.com/books?id=xIKK9RcSTR4C&q=bitmap+pixmap+one-bit+date:2004-2007&pg=PA93). Laxmi Publications. p. 93. [ISBN](/source/ISBN_(identifier)) [81-7008-185-8](https://en.wikipedia.org/wiki/Special:BookSources/81-7008-185-8).

1. **[^](#cite_ref-5)** Julian Smart; Stefan Csomor & Kevin Hock (2006). [*Cross-Platform GUI Programming with Wxwidgets*](https://books.google.com/books?id=CyMsvtgnq0QC&q=bitmap+pixmap+gui&pg=PA265). Prentice Hall. [ISBN](/source/ISBN_(identifier)) [0-13-147381-6](https://en.wikipedia.org/wiki/Special:BookSources/0-13-147381-6).

1. **[^](#cite_ref-DIBhelp_6-0)** ["DIBs and Their Uses"](http://support.microsoft.com/kb/q81498/). *Microsoft Help and Support*. 2005-02-11.

1. **[^](#cite_ref-7)** ["List of bitmap file types"](https://web.archive.org/web/20061004193717/http://www.file-extensions.org/filetype/extensions/name/Bitmap+image/). *File-Extensions.org*. Archived from [the original](http://www.file-extensions.org/filetype/extensions/name/Bitmap+image/) on 2006-10-04. Retrieved 2007-09-22.

1. **[^](#cite_ref-8)** J. Thomas; A. Jones (2006). [*Communicating Science Effectively: a practical handbook for integrating visual elements*](https://books.google.com/books?id=xrgkojGgwDYC&q=gif+png+tiff+jpeg+common&pg=PA26). IWA Publishing. [ISBN](/source/ISBN_(identifier)) [1-84339-125-2](https://en.wikipedia.org/wiki/Special:BookSources/1-84339-125-2).

v t e Multimedia compression and container formats Video compression ISO, IEC, MPEG DV MJPEG Motion JPEG 2000 MPEG-1 MPEG-2 Part 2 MPEG-4 Part 2 / ASP Part 10 / AVC Part 33 / IVC MPEG-H Part 2 / HEVC MPEG-I Part 3 / VVC MPEG-5 Part 1 / EVC Part 2 / LCEVC ITU-T, VCEG H.120 H.261 H.262 H.263 H.264 / AVC H.265 / HEVC H.266 / VVC H.267 / Enhanced Compression Model SMPTE VC-1 VC-2 VC-3 VC-5 VC-6 TrueMotion and AOMedia TrueMotion S VP3 VP6 VP7 VP8 VP9 AV1 AV2 Chinese Standard AVS1 P2/AVS+ (GB/T 20090.2/16) AVS2 P2 (GB/T 33475.2,GY/T 299.1) HDR Vivid (GY/T 358) AVS3 P2 (GY/T 368) Others Apple Video AVS Bink Cinepak Daala DVI FFV1 Huffyuv Indeo Lagarith Microsoft Video 1 MSU Lossless OMS Video Pixlet ProRes 422 4444 QuickTime Animation Graphics RealVideo RTVideo SheerVideo Smacker Sorenson Video/Spark Theora Thor Ut WMV XEB YULS Audio compression ISO, IEC, MPEG MPEG-1 Layer II Multichannel MPEG-1 Layer I MPEG-1 Layer III (MP3) AAC HE-AAC AAC-LD MPEG Surround MPEG-4 ALS MPEG-4 SLS MPEG-4 DST MPEG-4 HVXC MPEG-4 CELP MPEG-D USAC MPEG-H 3D Audio ITU-T G.711 A-law µ-law G.718 G.719 G.722 G.722.1 G.722.2 G.723 G.723.1 G.726 G.728 G.729 G.729.1 IETF Opus iLBC Speex Vorbis FLAC 3GPP AMR AMR-WB AMR-WB+ EVRC EVRC-B EVS GSM-HR GSM-FR GSM-EFR ETSI AC-3 AC-4 DTS Bluetooth SIG SBC LC3 Chinese Standard AVS1 P10 (GB/T 20090.10) AVS2 P3 (GB/T 33475.3) Audio Vivid (GY/T 363) DRA (GB/T 22726) ExAC (SJ/T 11299.4) Others ACELP ALAC Asao ATRAC CELT Codec 2 iSAC Lyra MELP Monkey's Audio MT9 Musepack OptimFROG OSQ QCELP RCELP RealAudio SD2 SHN SILK Siren SMV SVOPC TTA True Audio TwinVQ VMR-WB VSELP WavPack WMA MQA aptX aptX HD aptX Low Latency aptX Adaptive LDAC LHDC LLAC TrueHD Image compression IEC, ISO, IETF, W3C, ITU-T, JPEG CCITT Group 4 GIF HEIC / HEIF HEVC JBIG JBIG2 JPEG JPEG 2000 JPEG-LS JPEG XL JPEG XR JPEG XS JPEG XT PNG APNG TIFF TIFF/EP TIFF/IT Others AV1 AVIF BPG DjVu EXR FLIF ICER MNG PGF QOI QTVR WBMP WebP Containers ISO, IEC MPEG-ES MPEG-PES MPEG-PS MPEG-TS ISO/IEC base media file format MPEG-4 Part 14 (MP4) Motion JPEG 2000 MPEG-21 Part 9 MPEG media transport ITU-T H.222.0 T.802 IETF RTP Ogg Matroska SMPTE GXF MXF Others 3GP and 3G2 AMV ASF AIFF AVI AU BPG Bink Smacker BMP DivX Media Format EVO Flash Video HEIF IFF M2TS Matroska WebM QuickTime File Format RatDVD RealMedia RIFF WAV MOD and TOD VOB, IFO and BUP Collaborations NETVC MPEG LA Alliance for Open Media Methods Entropy Arithmetic Huffman Modified LPC ACELP CELP LSP WLPC Lossless Lossy LZ DEFLATE LZW PCM A-law µ-law ADPCM DPCM Transforms DCT FFT MDCT Wavelet Daubechies DWT Lists Comparison of audio coding formats Comparison of video codecs List of codecs See Compression methods for techniques and Compression software for codecs

Authority control databases GND

---
Adapted from the Wikipedia article [Bitmap](https://en.wikipedia.org/wiki/Bitmap) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Bitmap?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
