Image data is a two-dimensional array or function f(x,y) with spatial coordinates. The amplitude of the coordinate(x,y) is known as intensity. In Python, an image is a 2D or 3D NumPy array with pixel values. Pixels are the smallest, core tiny picture elements, which decide the image quality. A large number of pixels results in a higher resolution. Also, there are various image formats available, such as .jpeg, .png, .gif, and .tiff. These file formats are helpful in organizing and maintaining digital image files. Before analyzing image data, we need to understand the types of images. Image data can be of three types:
- Binary
- Grayscale
- Color
Binary images
Binary image pixels have only two colors, generally black and white. Binary image pixels take only binary values 0 or 1.
The preceding image is an example of a binary image. It has only two colors, black and white. It does not use shades of black and white.
Grayscale images
A grayscale image looks like a black...