What are the commonly used image compression methods in image processing?
So here comes the question, there is a most basic question, What is an image?
The images we encounter nowadays are mostly digital images (so we won’t discuss analog images anymore). What is a digital image? A digital image is an image composed of individual pixels. Take a look at the image below—what we see directly appears continuous, but when zoomed in, it becomes clear that the image is made up of small squares, and these small squares are called pixels. An image composed of individual pixels is a digital image. In fact, digital images have a stricter definition, but for now, it’s enough to grasp the most basic concept—just understand it.
In other words, to represent an image on a computer, we only need to represent the information of each pixel. We know that red, green, and blue (RGB) are the foundation of all other colors. All colors can be obtained by mixing these three colors in different proportions. Therefore, the information of each pixel is its RGB information. On a computer, the intensity of red, green, and blue is represented by 8-bit binary numbers, meaning red has 0–255 levels, and the same goes for green and blue. Different levels of RGB can display different colors. Each pixel includes all RGB information, requiring 24 bits of binary, hence it’s called 24-bit true color. So the number of bits stored for an image is 24 × the number of pixels.
Besides the RGB color space, there is another color space called YUV. Here, “Y” represents luminance, while “U” and “V” represent chrominance, which describes the color and saturation of the image and specifies the pixel’s color. “Luminance” is derived from the RGB input signal by superimposing specific parts of the RGB signal. “Chrominance” defines two aspects of color—hue and saturation—represented by Cr and Cb, respectively. Cr reflects the difference between the red part of the RGB input signal and the luminance value of the RGB signal, while Cb reflects the difference between the blue part of the RGB input signal and the luminance value of the RGB signal. The human eye is more sensitive to luminance than chrominance, which allows for some reduction in chrominance information without being noticeable—this is one source of image compression. The importance of the YUV color space lies in the separation of its luminance signal (Y) and chrominance signals (U, V). If only the Y signal is present without U and V components, the resulting image is black and white.
The conversion between YUV and RGB is as follows:
Y = 0.257R + 0.504G + 0.098B + 16
Cr = V = 0.439R - 0.368G - 0.071B + 128
Cb = U = -0.148R - 0.291G + 0.439B + 128
B = 1.164(Y - 16) + 2.018(U - 28)
G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128)
R = 1.164(Y - 16) + 1.596(V - 128)
The value ranges for RGB are 0~255, Y = 0~255, U = -122~+122, V = -157~+157. Moreover, YUV values are generally not integers and are difficult to store accurately on computers, leading to some degree of data loss. Therefore, images are primarily stored in RGB (24-bit true color BMP), while the YUV color space, being more aligned with human visual characteristics, is more meaningful for compression.