IMAGE DATA REPRESENTATION

By end of this topic, you will be able to describe how image data are represented in computer. 

Pixel

Pixel is the smallest element of an image. Each pixel correspond to any one value. 


In an 8 bit grey scale image, the value of the pixel between 0 and 255. The value of a pixel at any point correspond to the intensity of the light photons striking at that point. Each pixel store a value proportional to the light intensity at that particular location.

Bitmap File Calculation

There are TWO (2) factors that influences the bitmap file size. There are (1) Resolution (image width x image height) and (2) Bit Depth (number of bits to store colors).

Bitmap Image File Size = Resolution x Bit Depth

Resolution

Resolution is the number of pixels in an image. Resolution is calculated by width (pixel) × height (pixel). The higher the pixel in an image, the greater the image file size will be. 

more pixel = more file size = more storage space

Bit Depth

Bit depth is also known as bits per pixel (bpp). It is the number of bits required to store colors in each pixel. The number of different colors in an image is depends on bit depth. 

Monochrome or the black and white images require only 2 bits to store the colors. Each pixel in monochrome image can only be either black or white, so we can represent this image with two colors. Therefore,  bit 1 is used to represent the white color , and bit 0 to represent the black color in the image.

The more colors used in an image, the more bits is needed and eventually increases the file size. 

more colors = more bits = more file size = more storage space

Therefore, more bits required for a colour image. The number of colors that can be represented in an image can be calculated based on bit depth or bits per pixel used. Below are the formula to calculate the number of colors can be represented for a pixel:

2 bits per pixel

Example a 8 bits image can be represented with 256 colors (2 8 = 256).

Copyright @ 2024 Prasanna Ramakrisnan. All Rights Reserved