An image is represented in a three-dimensional array or a rank 3 tensor, and the first two dimensions are the picture’s width and height coordinates for each pixel position. The third dimension is a red, blue, and green (RGB) value ranging from zero to 255 or #0 to #FF in hexadecimal. The equivalent of RGB in printing is cyan, magenta, yellow, and key (CMYK). The other popular format is hue, saturation, and value (HSV). The salient point is that a photo is a matrix of an integer or float when normalized.
Visualizing the image as a matrix of numbers makes it easy to transform it. For example, in HSV format, changing the saturation value to zero in the matrix will convert an image from color into grayscale.
Dozens of filters alter the color space characteristics, from the basics to exotic ones. The basic methods are darkened, lightened, sharpened, blurring, contrast, and...