# Pixel, Resolution and Framebuffer

Pixel, resolution and framebuffer are frequently used terminologies in computer graphics. Let us understand them one by one.

## Pixel:

The pixel is the smallest addressable unit of an image. It is also known as pel or picture element. Real-world objects are continuous in nature and hence they have infinite samples. When they are converted into an image and displayed on the monitor screen, only finite samples are taken into consideration. Ultimately, the object on the computer screen is a collection of pixels.

Like the digital image, the monitor screen is also divided into a grid, consisting n rows and m columns. Each cell on this grid is also referred to as a pixel. Each grey/black cell in the figure corresponds to one pixel.

On zooming in the image, we can get a better idea of the pixel. Each square in the Figure represents one pixel.

For a grayscale image, pixel value varies from 0 to 255, where 0 represents black colour and 255 represents white colour. In between range represents the grey shades with varying intensities.

For a colour image, each pixel is a triplet of colour (R, G, B) consisting of proportions of red, green and blue colour. The mixture of these three components determines the final colour of the pixel on the monitor screen. The value of each component varies from 0 to 255, resulting in 255 x 255 x 255 = approximately 17 million different shades of colour.

## Resolution:

The maximum number of pixels that can be displayed without overlap on the monitor screen is called screen resolution. The typical resolution on high-quality systems is 1280 by 1024. Such high-resolution systems are often referred to as
high-definition systems.

Images on the monitor screen are described by their resolution. An image with a resolution 800 x 600 means that the image has 800 pixels in each row and 600 pixels in each column. Image contains total
800 x 600 = 4, 80, 000 pixels.

As resolution decreases, fewer samples will be captured and image quality gets poor. Images with resolutions 256 x 256, 64 x 64 and 16 x 16 are shown in the below figure.

## Framebuffer:

We can consider the screen picture as a two-dimensional grid of pixels. The raster system displays the picture by drawing pixels in a row by row from left to right. Picture definition is stored in a memory called the refresh buffer or frame buffer.

The scene to be displayed is first loaded into the frame buffer in the form of intensity values. Ideally, the size of the frame buffer is the same as the screen resolution. The intensity value from the top left location of the frame buffer is retrieved and painted at a top left location on the screen. The second pixel of the same row is painted soon after that and this process continues.

Frame buffers in raster display store individual pixels of the scene, whereas in the case of random scan display, frame buffers store commands for drawing the scene.

Suppose a system has a resolution of 1280 x 1280 and it supports 24 bits per pixel. The memory requirement for the frame buffer is :

Number of pixel     =   1280 x 1280 = 16, 38, 400

Number of bits     =   Number of pixels x Number of bits/pixel

=   16, 38, 400 x 24

=   3, 93, 21, 600 bits

=   39321600/8 = 49,15,200 Bytes         (∵ 1 Byte = 8 bits)

=   49,15,200/1024 = 4800 KB               (∵  1 KB = 1024 Bytes)

=   4800/1024 = 4.69 MB                      (∵  1 MB = 1024 KB)

Thus, the system having a screen resolution of 1280 x 1280 and supporting 24 bits per pixel requires 4.69 MB of memory for the frame buffer.

The frame buffer is known as a bitmap if it uses one bit per pixel. It is known as a pixmap if it uses multiple bits per pixel. A bitmap is used in a bi-level system while a pixmap is used in a system supporting multiple colors.

Sometimes additional alpha channel is retained to adjust the transparency of the pixel.