What redundancy is generally used to compress image files?
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.
1. Basic introduction
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.
2. Coding redundancy
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:
3. Inter-pixel redundancy
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.
3. Psychovisual redundancy
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.
4. Fidelity criterion
4.1 Objective Fidelity Criterion
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.
-
Root mean square error (rms)
Overall error of the two pictures:
Among them, f (x,y) represents the input image, and f(x,y) represents the estimate or approximation obtained by compressing and decompressing the input image
The root mean square error of the two pictures; - Mean square signal-to-noise ratio
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
