Pixel (source code)

= Pixel
{wiki}

A <pixel> is one picture element at an indexed position in a <raster image>. It can contain a single <grayscale> value or several colour components. The word can also refer to a physical display element; the indexed element of the stored image is the meaning used here. One stored <pixel> need not occupy exactly one physical display element when the image is resized. Microsoft's bitmap documentation likewise distinguishes an image's grid and its numerical colour representation.https://learn.microsoft.com/en-us/windows/win32/gdi/about-bitmaps[Microsoft Learn, About Bitmaps: pixel grids and bitmap representations]{ref}

Separate \i[position] from \i[value]: <raster sampling and reconstruction> concerns the spatial grid, while <sample depth> concerns how many <bits> encode each component. Four times as many <pixels> can describe a finer grid without improving the <quantization (signal processing)> of any value. Conversely, more <bits> per sample can distinguish more shades without locating an edge more precisely.

In the binary example under <run-length encoding>, one <bit> per <pixel> selects black or white. In the <grayscale> example under <lossy block averaging>, eight <bits> per <pixel> select one of 256 codes. Calling them codes keeps their numerical values distinct from the physical light that a display emits.