How do computers understand images?

We live in the age of the “camera in everyone’s pocket”. So digital images are something we see every other day. Can you count the number of images you see in a day while scrolling social media platforms? Just think about it and imagine how these images influence us. Have you ever contemplated how your images are stored on the computer or other digital devices?

Maybe you know that images are stored as 1’s and 0’s. If you didn’t know, yeah, it’s true. Digital images look stunning, so smooth and natural but they are all stored in numbers. What looks like an image is actually a collection of numbers.

Let’s take a look at a picture:

Now let’s zoom in on the picture. The above image is zoomed (1586%) to get the below image:

We can see tiny squares each showing one color. These tiny squares are called pixels. The word pixel is a combination of pix (from “pictures”, shortened to “pics”) and el (for “element”).

Pixels – basics

The pixels are the smallest unit in a digital image. A pixel is a color or light value that occupies a specific place in an image. If you zoom in far enough, we can see a grid-like structure. So, an image can be considered as a large grid with each square in the grid being the pixel containing one color.

Pixel Count

The dimension of an image is usually represented in the format X x Y (horizontal x vertical measurement). This is called the resolution of an image. Thus, an image with a resolution of 720 x 1080 tells us that the image measures 720 pixels in width and 1080 in height. The term resolution is often considered equivalent to pixel count. The pixel count is the number of pixels that form an image. To calculate the pixel count, we multiply the length(width) by the height.  Therefore, 1080 x 1616 equals 17,45,280 pixels. Typically, this number can be used by dividing it by a million to convert it into megapixels. So 17,45,280 / 1,000000 = 1.7 Megapixels. Now you must know that the dimension/resolution/pixel count of an image does not equate the physical dimension. This means that one pixel will not be one millimeter or one nanometer.

Pixel density

Pixel density refers to the number of pixels in a given area. Pixels-per-inch (ppi) and pixels-per-centimeter (ppcm) are measurements of pixel density.

Grayscale images

A grayscale or Black & white image is made up of black, white and many different shades of grey. Technically we can define a “grayscale image” as an image that is composed exclusively of shades of grey, varying from black to white.

In a grayscale image, each pixel has only a single value representing the light value; that is, it carries only intensity information. The pixel values range from 0 (black) to 255 (white).

The numbers closer to zero represent the darker shade while the numbers closer to 255 represent the lighter or the white shade.

grayscale image
Example of a grayscale image

The fundamental unit of information on a computer is a bit. A bit takes either the value of 0 or 1. A group of 8 bits is called one byte. Grayscale images have 8-bits and since each bit takes on one of two values, we can say that there are 28 = 256 possible values.

Colored images

Any color can be built using the correct combination of Red, Green, and Blue. Thus, pixels in color images are represented by three values (r, g, b). These values indicate the intensity of red, green, and blue, needed to render the image on the screen. The range of intensities is the same as grayscale images- 0 (none of the color appears) and 255(highest level of the color).

Similar Posts

Leave a Reply