Image files are generally compressed using coding redundancy, inter-pixel redundancy and psychovisual redundancy. Data redundancy is the main problem of digital image compression. In digital image compression, three basic data redundancies can be determined and utilized: coding redundancy, inter-pixel redundancy and psychovisual redundancy; when these three types of redundancy Data compression (reducing the amount of data required to represent a given amount of information) is achieved when one or more of are reduced or eliminated.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
The problem solved by image compression is to minimize the amount of data required to represent digital images, and to remove excess data based on the basic principle of reducing the amount of data.
Image compression model: Mainly introduces the encoding and decoding of signal sources, and does not discuss the signal channel of the transmission process. .
Data compression refers to reducing the amount of data required to represent a given amount of information.
Data is the means of information transmission. The same amount of information can be represented by different amounts of data.
Information: used to represent the information of the image itself.
Data redundancy is a major problem in digital image compression. If n1 and n2 represent the number of information units carried in two data sets representing the same information, then the relative data redundancy RD of the first data set (the set represented by n1) can be defined as :
Here C is usually called the compression ratio, which is defined as:
In digital image compression , three basic types of data redundancy can be identified and exploited: coding redundancy, inter-pixel redundancy, and psychovisual redundancy. Data compression is achieved when one or more of these three redundancies are reduced or eliminated.
For images, it can be assumed that a discrete random variable represents the gray level of the image, and each gray level The probability of (rk) appearing is pr
where L is the gray level, nk is the number of times the k-th gray level appears in the image, and n is the total number of pixels in the image. If the number of bits used to represent each rk value is l(rk), then the average number of bits required to represent each pixel is:
That is to say, the number of bits used to represent each gray level value is multiplied by the probability of gray level occurrence, and the resulting products are added to obtain the average codeword of different gray level values. length. If the average number of bits of a certain encoding is closer to the entropy, the encoding redundancy is smaller.
[Note]
Entropy: It defines the average amount of information obtained by observing the output of a single source
For example:
The entropy of the original image is: 2.588
Using natural binary encoding, the average length is;3
If using the table Medium encoding 2, the average number of bits is:
achieves coding compression, pr(rk) and l(r k) These two functions are multiplied and inversely proportional. That is to say, the greater the probability pr(rk) of a certain grayscale rk, the greater the coding length l(rk) should be smaller, which can reduce the average number of bits and bring it closer to the entropy. As shown below:
Inter-pixel redundancy is a kind of Inter-pixel correlations are directly linked to data redundancy.
For a static picture, there is spatial redundancy (geometric redundancy). This is because the visual contribution of a single pixel to the image in a picture is often redundant. Grayscale values are inferred.
For continuous pictures or videos, there will also be temporal redundancy (inter-frame redundancy). Most of the corresponding pixels between adjacent pictures are slowly excessive.
Psychovisual redundancy is related to real visual information. It varies from person to person. Different people have different psychological visual redundancy for the same photo. . Removing redundant psychovisual data will inevitably lead to the loss of quantitative information, and this loss of visual information is an irreversible operation. Just like an image (which cannot be enlarged) is relatively small, the human eye cannot directly judge its resolution. In order to compress the data volume of the image, some information that cannot be directly observed by the human eye can be removed, but when it is enlarged, it is not removed. An image with psychovisual redundancy will be significantly different from an image with psychovisual redundancy removed.
Figure C illustrates that the quantization process that fully utilizes the characteristics of the human visual system can greatly improve the performance of the image. Although the compression ratio of this quantization process is still only 2: 1, Additional overhead is added to reduce false contours, but unwanted graininess is reduced. The method used to produce this result is the improved gray scale (IGS) quantization method. This method is illustrated in the table below. First, the current 8-bit gray level value and the 4 least significant bits generated previously form a sum with an initial value of zero. If the 4 most significant bits of the current value are 1111, add 0000 to it. The value of the 4 most significant bits of the obtained sum is used as the encoded pixel value.
This is said when the degree of information loss can be expressed as a function of the initial image or input image and the output image that is first compressed and then decompressed Functions are based on objective fidelity criteria.
FAQ column!
The above is the detailed content of What redundancy is generally used to compress image files?. For more information, please follow other related articles on the PHP Chinese website!