Fight against cancer

domingo, 19 de noviembre de 2023

Pixel, voxel, hipervoxel, texel, bpp, dpi

When you buy a laptop, a TV, or a mobile phone, one of the specifications you appreciate is the number of pixels of the screen or the camera.

A pixel (px), in digital imaging is the smallest addressable element in a raster image or a 2D matrix. Whilst in most digital display devices, pixels are the smallest element that can be manipulated.

Each pixel can be a photosensor in a camera, or a group of 3 o 4 phosphor dots coloured in a screen. And their width could be different of their height.

The main color represtations of the dot in a screen are RGB with three components: red, green, and blue, or CMYK with four components: cyan, magenta, yellow and black.

For example a RGB screen of 1024 x 960 px will include 983040 pixels, each one with three coloured dots. And the color of each pixel will be representated with 2N bits. Then, if the color of the pixel is 16 bits (N=4), a raw image will be 1024*960*16 bits = 15728640 bits = 1966080 bytes, that is almost 2 MB .

1 MP = 1 megapixel = 1*106 pixels

The number of bits per pixel (bpp) is a measuse unit of the color depth of the representated pixels. In the previous example, 16 bpp, that are 65536 distinct colors.

bpp can include M bits for opacity. For example using 24 bpp in RGB: 8 bits for red, 8 bits for green, 8 bits for blue/cyan, and 8 bits for the opacity.

In 2D, the resolution is the number of pixels that are represented or maneged. In the previous example is 1024 x 960 px. Supposed 1024 rows of 960 columns.

In printers or scanners, the specifications are in dots per inch, dpi or DPI, that are the number of dots in a line within the span of 1 inch.

There are special cases like logical pixels, when an image is vectorial and its pixels can be accommodate into different screen rate of pixels. or when the density of the sensors or phosphor dots isn't constant along the screen or camera.

Nowadays, mobile phones that include different cameras, can use one or another according distances, light, ... And, probably, they don't have the same reesolution. Additionally, the software can change the resolution, and the pixels you see in the photo you've taken, probably doesn't match with the resolution of the camera used to take that photo.

Equivalently, many displays, include software that can change the resolution of the image received to depict it with more pixels, color filters, ...

In computing graphics, we usually work with 3 dimensional objects. This objects are usually composed by polygons with its coordinates and properties, but, in some cases another concept is used: the voxels.

A voxel is a 3D image in a 3D space witch has its own nodal point coordinates in an accepted coordinate system, its form, parameters, etc. Voxels are used in some cases like visualization and analysis of medical, or GIS data.

Voxels are the terrain objects we can see and manipulate in the Minecraft game as a cubic blocks, although internally uses polygons for rendering them.

There are some 3D displays that have their volumetric resolution in voxels, but normally are displayed in 2D screens using algorithms of rasterisation, ray tracing, ... that obtain a 2D raster.

An extension of the voxels are the hypervoxels, which are a generalization of them for higher-dimensional spaces.

A different generalization of pixels are the texels. A texel is the fundamental unit of a texture map.

A texel is an image or a pattern that is part of a texture that is applied on 2D or 3D surfaces (texture mapping).

When the textures on 3D surfaces are visualized on a display or are exported as an image or video, a combination of algorithms calculates the value of each pixel, in a process named rendering.

This is a brief of some related units used in computing graphics.


References: