A bitmap is an array of bits that states the shade of each pixel in a rectangular array of pixels. The number of bits committed to an individual pixel determines the number of colors that have the right to be assigned to the pixel. Because that example, if every pixel is represented by 4 bits, climate a offered pixel can be assigned one of 16 different colors (2^4 = 16). The adhering to table reflects a few examples that the variety of colors that deserve to be assigned to a pixel represented by a given number of bits.

You are watching: How many bits are required to create a pixel capable of displaying 65,536 different colors?

Bits every pixelNumber of color that have the right to be assigned come a pixel
12^1 = 2
22^2 = 4
42^4 = 16
82^8 = 256
162^16 = 65,536
242^24 = 16, 777, 216


Disk files that store bitmaps normally contain one or much more information blocks that store info such as number of bits per pixel, number of pixels in every row, and variety of rows in the array. Together a record might additionally contain a color table (sometimes dubbed a shade palette). A color table maps number in the bitmap to certain colors. The following illustration mirrors an enlarged image in addition to its bitmap and color table. Each pixel is stood for by a 4-bit number, so there room 2^4 = 16 color in the shade table. Each shade in the table is represented by a 24-bit number: 8 bits for red, 8 bits because that green, and also 8 bits for blue. The numbers are shown in hexadecimal (base 16) form: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.


Look at the pixel in heat 3, tower 5 of the image. The equivalent number in the bitmap is 1. The shade table tells united state that 1 to represent the color red, therefore the pixel is red. Every the entries in the peak row of the bitmap room 3. The color table tells us that 3 to represent blue, so all the pixels in the height row of the image are blue.


Some bitmaps room stored in bottom-up format; the numbers in the very first row that the bitmap exchange mail to the pixels in the bottom heat of the image.


A bitmap the stores indexes into a shade table is referred to as a palette-indexed bitmap. Some bitmaps have actually no need for a color table. Because that example, if a bitmap offers 24 bits per pixel, that bitmap can store the colors themselves rather than indexes into a color table. The complying with illustration mirrors a bitmap the stores colors straight (24 bits per pixel) quite than using a shade table. The illustration additionally shows an enlarged view of the equivalent image. In the bitmap, FFFFFF to represent white, FF0000 represents red, 00FF00 to represent green, and 0000FF to represent blue.



Graphics paper Formats

There are countless standard styles for conserving bitmaps in files. Windows GDI+ supports the graphics file formats explained in the complying with paragraphs.

Bitmap (BMP)

BMP is a standard layout used by home windows to save device-independent and application-independent images. The number of bits per pixel (1, 4, 8, 15, 24, 32, or 64) for a offered BMP record is stated in a record header. BMP documents with 24 bits per pixel are common.

Graphics Interchange layout (GIF)

GIF is a usual format for images that appear on internet pages. GIFs job-related well for line drawings, photos with blocks of solid color, and pictures with sharp boundaries between colors. GIFs space compressed, but no info is lost in the compression process; a decompressed image is specifically the exact same as the original. One color in a GIF deserve to be designated together transparent, so that the photo will have actually the background color of any type of Web web page that screens it. A sequence of GIF images deserve to be save in a single file to form an animated GIF. GIFs store at most 8 bits every pixel, for this reason they are restricted to 256 colors.

Joint Photographic professionals Group (JPEG)

JPEG is a compression scheme that functions well for organic scenes, such as scanned photographs. Some details is shed in the compression process, yet often the loss is imperceptible come the human being eye. Color JPEG images store 24 bits per pixel, so they are qualified of displaying an ext than 16 million colors. There is also a grayscale JPEG format that stores 8 bits per pixel. JPEGs execute not support transparency or animation.

The level the compression in JPEG images is configurable, but greater compression level (smaller files) result in much more loss of information. A 20:1 compression ratio frequently produces an image that the human eye finds an overwhelming to identify from the original. The adhering to illustration reflects a BMP image and also two JPEG photos that to be compressed from the BMP image. The first JPEG has a compression ratio of 4:1 and also the 2nd JPEG has actually a compression proportion of about 8:1.


JPEG compression does not work-related well because that line drawings, block of solid color, and sharp boundaries. The adhering to illustration shows a BMP together with two JPEGs and also a GIF. The JPEGs and the GIF to be compressed native the BMP. The compression ratio is 4:1 because that the GIF, 4:1 for the smaller sized JPEG, and 8:3 for the bigger JPEG. Note that the GIF maintains the sharp boundaries along the lines, but the JPEGs often tends to blur the boundaries.


JPEG is a compression scheme, no a file format. JPEG paper Interchange layout (JFIF) is a document format commonly used for storing and transferring images that have actually been compressed follow to the JPEG scheme. JFIF files presented by internet browsers usage the .jpg extension.

Exchangeable Image record (Exif)

Exif is a paper format supplied for photographs recorded by digital cameras. An Exif paper contains photo that is compressed follow to the JPEG specification. One Exif record also includes information about the photo (date taken, shutter speed, exposure time, and so on) and also information about the camera (manufacturer, model, and also so on).

Portable Network graphic (PNG)

The PNG format retains numerous of the advantages of the GIF layout but additionally provides capabilities beyond those the GIF. Prefer GIF files, PNG records are compressed through no lose of information. PNG documents can keep colors v 8, 24, or 48 bits per pixel and also gray scales v 1, 2, 4, 8, or 16 bits per pixel. In contrast, GIF files can use just 1, 2, 4, or 8 bits every pixel. A PNG file can additionally store an alpha value for each pixel, which states the degree to i m sorry the color of the pixel is mixed with the elevator color.

PNG boosts on GIF in its ability to progressively screen an image; the is, to display far better and better approximations that the photo as that arrives end a network connection. PNG records can contain gamma correction and also color correction details so the the images have the right to be accurately calculation on a variety of screen devices.

See more: To Late To Turn Back Now Lyrics Cornelius Brothers & Sister Rose ※ Mojim

Tag Image document Format (TIFF)

TIFF is a flexible and extendable layout that is sustained by a wide selection of platforms and also image-processing applications. TIFF files can store pictures with one arbitrary number of bits per pixel and also can rental a range of compression algorithms. Number of images deserve to be save in a single, multiple-page TIFF file. Information related come the picture (scanner make, hold computer, kind of compression, orientation, samples every pixel, and also so on) can be stored in the paper and arranged v the use of tags. The TIFF layout can be expanded as required by the approval and enhancement of brand-new tags.