1. The concept of image compression
Reduce the amount of data required to represent a digital image
2. The basic principle of image compression
The reason why image data can be compressed is because there is redundancy in the data. The redundancy of image data is mainly manifested as: spatial redundancy caused by the correlation between adjacent pixels in the image; temporal redundancy caused by correlation between different frames in the image sequence; correlation caused by different color planes or spectral bands. spectrum redundancy. The purpose of data compression is to reduce the number of bits required to represent data by removing these data redundancies. Due to the huge amount of image data, it is very difficult to store, transmit and process, so image data compression is very important.
The information age has brought about an "information explosion", which has greatly increased the amount of data. Therefore, data needs to be effectively compressed no matter whether it is transmitted or stored. In remote sensing technology, various space probes use compression coding technology to send the huge information they get back to the ground.
Image compression is the application of data compression technology to digital images. Its purpose is to reduce redundant information in image data so as to store and transmit data in a more efficient format.
3. Basic methods of image compression
Image compression can be either lossy or lossless data compression. Lossless compression is preferred for drawing technical drawings, diagrams or comics, because lossy compression methods, especially at low bit rates, will cause compression artifacts. The compression of valuable content such as medical images or scanned images for archiving should also choose a lossless compression method as much as possible. Lossy methods are very suitable for natural images, such as some applications where small image loss is acceptable (sometimes unperceptible), so that the bit rate can be greatly reduced.
Lossless image compression methods are:
Run Length Encoding
Adaptive dictionary algorithms like LZW
Lossy compression methods are:
Reduces the color space to the colors commonly used in the image. The selected color is defined in the palette of the compressed image header, and each pixel in the image is represented by a color index in the palette. This method can be used with dithering (en:dithering) to blur color boundaries.
Chroma sampling, which utilizes the human eye's sensitivity to brightness changes is much greater than color changes, so that the color information in the image can be reduced by half or even more.
Transform coding, which is the most common method. First use a Fourier-related transform such as discrete cosine transform (DCT) or wavelet transform, then quantize and compress with entropy coding.
Fractal compression (en:Fractal compression).
The basic principle of lossless compression is that the same color information only needs to be saved once. Software that compresses images first determines which areas of the image are the same and which are different. Images that include repeated data (such as blue sky) can be compressed, and only the start and end points of the blue sky need to be recorded. But the blue may also have different shades, and the sky may sometimes be obscured by trees, mountains, or other objects, which need to be recorded separately. Essentially, a lossless compression method that removes some duplicate data, greatly reducing the size of the image to be saved on disk. However, lossless compression does not reduce the image's memory footprint because software fills in the lost pixels with the appropriate color information when the image is read from disk. If you want to reduce the amount of memory an image takes up, you must use a lossy compression method.
The advantage of the lossless compression method is that it can better preserve the quality of the image, but relatively speaking, the compression rate of this method is relatively low. However, if you need to print the image with a high-resolution printer, it is best to use lossless compression. Almost all image files use their respective simplified format names as file extensions. From the extension, you can know what format the image is stored in, what software should be used to read/write it, and so on.