What are digital images?

A combination of a finite number of pixels, f(x,y)f(x,y) is an image where xx and yy are spatial coordinates and ff is the image's gray level at xx. In computer language, a picture is a two-dimensional array with xx and yy coordinates arranged as rows and columns. There are two types of images:

  1. Analog images: These images have a continuous range of values of x,yx,y, and ff.

  2. Digital images: These images have discrete quantities of x,y,x,y, and ff .

Note: To know more about image processing, click here.

Pixels

A digital image contains a finite set of elements called pixels. They are also known as picture elements or image elements. An image is represented in the form of a matrix where each element consists of single pixels. Each pixel is the smallest point on the image that takes on a particular opacity, color, or shade.

Let's say we have an image with a size of 200 x 200 (width x height). The total number of pixels in the picture is 400000.

Types of digital images

Binary images

The binary images only have two-pixel elements, 0 and 1. 0 represents black entirely and 1 represents white.

A binary image
A binary image

Grayscale images

In a grayscale image, the pixel is an integer value between 0–255. Zero is entirely black, and 255 is white. Gray falls around 127 leading to the white color. These images are also known as 8-bit color format images.

A grayscale image
A grayscale image

Note: Binary images and grayscale images are 2-dimensional arrays, so we have one value to represent the pixel at each location.

RGB images

In RGB images, a pixel consists of three integers, and the value range is 0 to 255. These images are made up of three primary RGB colors. R stands for red, G stands for green, and B stands for blue. These RGB images are also known as colored images.

An RGB image
An RGB image

These images are represented in a 3-D matrix or a 3-dimensional array. These images use the high color format known as the 16-bit color format.

Note: RGBA is an extension of RGB with the new alpha field which is used to represent the opacity of the image.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved