What Is Image Compression?
Remove redundant data. From a mathematical point of view, this process is actually transforming a two-dimensional pixel array into a statistically unrelated data set.
- Remove redundant data. From a mathematical point of view, this process is actually transforming a two-dimensional pixel array into a statistically unrelated data set.
- Image compression is a technique that represents the original pixel matrix with lossless or lossless bits. It is also called image coding.
Image compression image compression principle
- 1. The concept of image compression
- Reduce the amount of data needed to represent digital images
- 2. Basic principles of image compression
- The reason why image data can be compressed is because there is redundancy in the data. The redundancy of image data mainly manifests as: spatial redundancy caused by the correlation between adjacent pixels in the image; temporal redundancy caused by the correlation between different frames in the image sequence; caused by the correlation between different color planes or spectral bands Spectrum redundancy. The purpose of data compression is to reduce the number of bits required to represent the data by removing these data redundancy. Because of the huge amount of image data, it is very difficult to store, transfer, and process, so the compression of image data becomes very important.
- The information age has brought about an "information explosion", which has greatly increased the amount of data. Therefore, it is necessary to effectively compress data regardless of transmission or storage. 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 and to store and transmit data in a more efficient format.
- 3. Image compression basic method
- Image compression can be lossy data compression or lossless data compression. For technical drawings, charts, or comics, such as lossless compression is preferred, because lossy compression methods, especially at low bit rate conditions, will cause compression distortion. For the compression of such valuable content as medical images or scanned images used for archiving, the lossless compression method should be selected as far as possible. The lossy method is very suitable for natural images. For example, small losses of images in some applications are acceptable (sometimes not perceivable), which can greatly reduce the bit rate.
- Lossless image compression methods are:
- Run-length encoding
- Entropy coding
- Adaptive dictionary algorithms like LZW
- Lossy compression methods are:
- Reduces color space to the colors commonly used in images. The selected color is defined in the palette of the compressed image header, and each pixel in the image is represented by the color index in the palette. This method can be used with dithering to blur color boundaries.
- Chroma sampling, which makes use of 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 more.
- Transform encoding, this is the most commonly used method. First, a Fourier correlation transform such as a discrete cosine transform (DCT) or a wavelet transform is used, and then quantization and compression are performed using entropy coding.
- Fractal compression (en: Fractal compression).
- 4. The main goal of image compression is to achieve the best image quality at a given bit-rate or compression ratio. However, there are other important features of image compression mechanisms:
- Scalability (en: Scalability) usually indicates the degradation in quality (without decompression and recompression) of operating bitstreams and files. Some other names for scalable coding are progressive coding (en: progressive coding) or embedded bitstreams (en: embedded bitstreams). Despite the different characteristics, there is also scalable coding in lossless coding, which is usually a format that uses coarse to fine pixel scanning. Extensible coding is especially useful when previewing images when downloading (as in a browser) or providing different image quality access (as in a database). There are several different types of scalability:
- Quality progressive (en: Quality progressive) or layer progressive (en: layer progressive): Bitstream progressively updates the reconstructed image.
- Resolution progressive (en: Resolution progressive): first encode the image at low resolution, then the difference between encoding and high resolution.
- Component progressive (en: Component progressive): encode gray data first, then color data.
- Region-of-interest coding. The quality of some parts of the image is better than others. This method can be combined with scalable coding (coding these parts first, and then other parts).
- Metadata information. Compressed data can contain information about images to classify, query, or browse images. This information can include color, texture statistics, small preview images, and author and copyright information.
- 5. Current standards for image compression
- Classic video compression algorithms have gradually formed a series of international standard systems, such as H.26x series recommendations, H.320 series recommendations, and MPEG series recommendations.
- 6. Evaluation of image compression effect
- The quality of the compression method is often measured using the peak signal-to-noise ratio, which is used to represent the noise caused by lossy compression of the image. However, the subjective judgment of the observer is also considered to be an important and perhaps most important measure.
Lossless image compression
Image compression principle
- The basic principle of lossless compression is that the same color information only needs to be saved once. The software that compresses an image 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 blue may have different depths, and the sky may sometimes be covered by trees, peaks, or other objects, and these need to be recorded separately. In essence, the lossless compression method can delete some duplicate data and greatly reduce the size of the image to be saved on the disk. However, the lossless compression method cannot reduce the memory consumption of the image, because when the image is read from the disk, the software will fill in the missing pixels with appropriate color information. If you want to reduce the amount of memory your image uses, you must use a lossy compression method.
Image compression advantages
- The advantage of the lossless compression method is that it can save the image quality better, but the compression ratio of this method is relatively low. However, if you need to print the image with a high-resolution printer, it is better to use lossless compression. Almost all image files use their simplified format names as file extensions. From the extension, you can know in what format the image is stored, what software should be used to read / write, and so on.