Search This Blog

Sunday, 20 October 2013

bitmapped image

A bitmap is a series of bits (within a series of bytes in memory) in which the bits represent the pixels in an image. In a monochrome bitmap, each pixel can be represented by one bit, with a 1 indicating that the pixel is “on.” For gray-scale or color images several bits must be used to store the information for each pixel. The pixel value bits are usually preceded by a data structure that describes various charac-teristics of the image.

For example, in the Microsoft Windows BMP format, the file for an image begins with a BITMAPFILEHEADER that includes a file type, size, and layout. This is followed by a BITMAPINFOHEADER that gives information about the image itself (dimensions, type of compression, and color format). Next comes a color table that describes each

color found in the image in terms of its RGB (red, green, blue) components. Finally comes the consecutive bytes rep-resenting the bits in each line of the image, starting from lower left and proceeding to the upper right.

The actual number of bits representing each pixel depends on the dimensions of the bitmap and the num-ber of colors being used. For example, if the bitmap has a maximum of 256 colors, each pixel value must use one byte to store the index that “points” to that color in the color table. However, an alternative format stores the actual RGB values of each pixel in three consecutive bytes (24 bits), thus allowing for a maximum of 24 (16,777,216) colors (see color in computing).


Shortcomings and Alternatives

The relationship between number of possible colors and amount of storage needed for the bitmap means that the more realistic the colors, the more space is needed to store an image of a given size, and generally, the more slowly the bitmap can be displayed. Various techniques have been used to shrink the required space by taking advantage of redun-dant information resulting from the fact that most images have areas of the same color (see data compression).

Vector graphics offer an alternative to bitmaps, particu-larly for images that can be constructed from a series of lines. Instead of storing the pixels of a complete image, vector graph-ics provides a series of vectors (directions and lengths) plus the necessary color information. This can make for a much smaller image, as well as making it easy to scale the image to any size by multiplying the vectors by some constant.

No comments:

Post a Comment