What is a pixel?

What is a pixel in a raster?

In its simplest form, a minimum unit of a cell size in a matrix of cells (or pixels) organized into rows and columns (or a grid) where each cell contains a value representing information, such as temperature.


The pixel in computer image

The pixel (a word invented from "picture element") is the basic unit of programmable color on a computer display or in a computer image. Think of it as a logical - rather than a physical - unit. The physical size of a pixel depends on how you've set the resolution for the display screen. If you've set the display to its maximum resolution, the physical size of a pixel will be equal the physical size of the dot pitch (let's just call it the dot size) of the display. If, however, you've set the resolution to something less than the maximum resolution, a pixel will be larger than the physical size of the screen's dot (that is, a pixel will use more than one dot).

The specific color that a pixel describes is some blend of three components of the color spectrum - RGB. Up to three bytes of data are allocated for specifying a pixel's color, one byte for each major color component. A true color or 24-bit color system uses all three bytes. However, many color display systems use only one byte (limiting the display to 256 different colors).

A bitmap is a file that indicates a color for each pixel along the horizontal axis or row (called the x coordinate) and a color for each pixel along the vertical axis (called the y coordinate). A Graphics Interchange Format file, for example, contains a bitmap of an image (along with other data).

Bits per pixel-based

The number of distinct colors that can be represented by a pixel depends on the number of bits per pixel (bpp). A 1 bpp image uses 1-bit for each pixel, so each pixel can be either on or off. Each additional bit doubles the number of colors available, so a 2 bpp image can have 4 colors, and a 3 bpp image can have 8 colors:

1 bpp, 21 = 2 colors (monochrome)

2 bpp, 22 = 4 colors

3 bpp, 23 = 8 colors

4 bpp, 24 = 16 colors

5 bpp, 25 = 32 colors

6 bpp, 26 = 64 colors

7 bpp, 27 = 128 colors

8 bpp, 28 = 256 colors

16 bpp, 216 = 65,536 colors ("Highcolor" )

24 bpp, 224 = 16,777,216 colors ("Truecolor")

For color depths of 15 or more bits per pixel, the depth is normally the sum of the bits allocated to each of the red, green, and blue components. Highcolor, usually meaning 16 bpp, normally has five bits for red and blue, and six bits for green, as the human eye is more sensitive to errors in green than in the other two primary colors. For applications involving transparency, the 16 bits may be divided into five bits each of red, green, and blue, with one bit left for transparency. A 24-bit depth allows 8 bits per component. On some systems, 32-bit depth is available: this means that each 24-bit pixel has an extra 8 bits to describe its opacity (for purposes of combining with another image).