CN115695793A - JPEG image compression system - Google Patents
JPEG image compression system Download PDFInfo
- Publication number
- CN115695793A CN115695793A CN202211326728.4A CN202211326728A CN115695793A CN 115695793 A CN115695793 A CN 115695793A CN 202211326728 A CN202211326728 A CN 202211326728A CN 115695793 A CN115695793 A CN 115695793A
- Authority
- CN
- China
- Prior art keywords
- image
- quantization
- module
- jpeg
- image compression
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention relates to a JPEG image compression system, belonging to the field of image processing. The JPEG image compression system of the invention comprises: the device comprises a DCT module, a quantization module, a Huffman transformation module, an image complexity evaluation module and a quantization coefficient selection module. The invention comprehensively considers two JPEG image compression parameters of image quality and image compression ratio in the continuous multi-frame image compression process, and selects and determines the quantization coefficient used for quantization according to the self characteristics of the input image, thereby increasing the flexibility of the JPEG image compression process and obtaining the balanced image quality and image compression ratio. The invention is applied to occasions needing to compress the original RAW image into a JPEG image. The invention has the advantages that the JPEG quantization coefficient is selected according to the self characteristics of the image in the continuous multi-frame image compression process, and the loss of image quality is reduced as much as possible while the image compression is realized.
Description
Technical Field
The invention belongs to the field of image processing, and particularly relates to a JPEG image compression system.
Background
With the development of technologies such as internet, multimedia, communication and the like, the application of images in reality is more and more extensive, and the compression coding technology of images is crucial to the storage and transmission of a large amount of data in image processing. The JPEG static image compression standard is one of main standards in image compression, and JPEG is a lossy compression algorithm based on DCT (discrete cosine transform) and has the characteristic of high compression ratio.
The block diagram of the steps of JPEG image compression is shown in FIG. 1. Quantization in the implementation of JPEG image compression is a reduction process on DCT-transformed frequency coefficients to increase the number of zero coefficients therein. In the quantization step, the relatively unimportant alternating current coefficients representing the image details in the image are removed by reducing the precision of the DCT coefficients, and then the subsequent Huffman coding is matched, so that the image data volume is reduced, and the compression purpose is achieved. Quantization is the most important cause of image quality degradation. In some applications of JPEG image compression, it is necessary to compress multiple frames of images in succession. Since each frame of image is different and has its own characteristics, if all the images are compressed by using the same set of quantization coefficients, the image quality after image compression and the compression ratio of the images are inconsistent. For example, if the single quantization coefficient used is small, the compressed image data volume of the complex RAW image with rich details is large, and the compression ratio is small; if a single quantization coefficient is used, the amount of compressed image data is small for a simple RAW image with less detail, and the overall visual effect of the image is poor.
The invention comprehensively considers two JPEG image compression parameters of image quality and image compression ratio in the continuous multi-frame image compression process, and selects and determines the quantization coefficient used for quantization according to the self characteristics of the input image, thereby increasing the flexibility of the JPEG image compression process and obtaining the balanced image quality and image compression ratio.
Disclosure of Invention
Technical problem to be solved
The invention aims to provide a JPEG image compression system to realize image compression and reduce the loss of image quality as much as possible.
(II) technical scheme
In order to solve the technical problem, the invention provides a JPEG image compression system which comprises a DCT module, a quantization module, a Hoffman transformation module, an image complexity evaluation module and a quantization coefficient selection module;
a DCT module: the discrete cosine transform operation of the JPEG image compression standard is realized, the input of the discrete cosine transform operation is an original RAW image, and the output of the discrete cosine transform operation is the input of a quantization module;
a quantization module: the quantization operation of the JPEG image compression standard is realized, the input of the quantization operation is the result of discrete cosine transform performed by the DCT module, and the output of the quantization operation is the input of the Hoffman transform module;
a Hoffman transform module: the method realizes the Hoffman transform operation of the JPEG image compression standard, the input of the operation is the result of quantization performed by a quantization module, and the output of the operation is JPEG image compression result data;
an image complexity evaluation module: evaluating the complexity of the image, inputting an original RAW image, outputting an image complexity index, and providing the image complexity index for a quantization coefficient selection module to select a quantization coefficient;
a quantization coefficient selection module: and selecting a quantization coefficient in the image quantization process, outputting the image quantization coefficient, and providing the image quantization coefficient for a quantization module to quantize a discrete cosine transform result.
Furthermore, the DCT module, the quantization module and the Huffman transformation module are realized according to JPEG image compression standard.
Further, the image complexity evaluation module uses the variance of the image as a characterizing value of the image complexity.
Further, the resolution of the input image img (m, n) is W × H, W is the image horizontal direction resolution, H is the image vertical direction resolution, 0-type yarns m is less than or equal to W-1, and 0-type yarns n is less than or equal to H-1; variance of the image is
Where mean (img) is the average of the pixel gray values of the image; the gray value of the image is in the range of 0-2 N -1, where N is the number of bits used for image single pixel storage.
Further, the quantization coefficient selection module selects a quantization coefficient in an image quantization process as follows:
s11, averagely dividing the image complexity index into ten grades of L1, L2, \8230;, L10;
s12, defining 10 quantization tables of Q1, Q2, 8230, 8230and Q10 according to the quantization degree;
and S13, selecting a corresponding quantization table according to the input image complexity level.
Further, in the step S11, L10 is a lowest complexity level, which represents that the complexity of the image is low; l1 is the highest level of complexity, representing a higher image complexity.
Further, in step S12, the image quantization degrees decrease sequentially from Q1 to Q10.
Further, in step S13, the corresponding quantization table Qi is selected according to the complexity level Li of the image, i =1, 2, \8230, 10
Further, after the step S13, the method further includes: after the quantization table is selected, the quantization table is applied to carry out quantization operation in the jpeg standard.
Further, the quantization degrees of the quantization tables are sequentially decreased, the quantization degrees of the images are sequentially decreased, the sizes of the finally obtained compressed images are sequentially increased, and the compression ratios achieved by jpeg compression are sequentially decreased.
(III) advantageous effects
The invention provides a JPEG image compression system which comprehensively considers two JPEG image compression parameters, namely image quality and image compression ratio in the continuous multi-frame image compression process, selects and determines quantization coefficients used for quantization according to the characteristics of an input image, thereby increasing the flexibility of the JPEG image compression process and obtaining balanced image quality and image compression ratio.
The invention is applied to occasions needing to compress the original RAW image into a JPEG image. The invention has the advantages that the JPEG quantization coefficient is selected according to the self characteristics of the image in the continuous multi-frame image compression process, and the loss of image quality is reduced as much as possible while the image compression is realized.
Drawings
FIG. 1 is a block diagram of a prior art JPEG image compression;
FIG. 2 is a block diagram of the present invention for selecting JPEG image compression with quantization coefficients considering image complexity;
fig. 3 is a diagram illustrating a method for selecting a quantization coefficient according to image complexity.
Detailed Description
In order to make the objects, contents and advantages of the present invention more apparent, the following detailed description of the present invention will be made in conjunction with the accompanying drawings and examples.
The invention is applied to occasions needing to compress the original RAW image into a JPEG image. The invention has the advantages that the JPEG quantization coefficient is selected according to the self characteristics of the image in the continuous multi-frame image compression process, and the loss of image quality is reduced as much as possible while the image compression is realized.
The invention takes the image complexity as the basis for selecting the image quantization coefficient in the JPEG image compression process. The implementation block diagram is shown in fig. 2.
The following is a block description of the contents of fig. 2. The JPEG image compression system of the invention comprises: the system comprises a DCT module, a quantization module, a Huffman transformation module, an image complexity evaluation module and a quantization coefficient selection module; wherein the content of the first and second substances,
a DCT module: the discrete cosine transform operation of the JPEG image compression standard is realized, the input of the discrete cosine transform operation is an original RAW image, and the output of the discrete cosine transform operation is the input of a quantization module;
a quantization module: the quantization operation of the JPEG image compression standard is realized, the input of the quantization operation is the result of discrete cosine transform performed by a DCT module, and the output of the quantization operation is the input of a Huffman transform module;
a Huffman conversion module: the Hoffman transform operation of the JPEG image compression standard is realized, the input of the Hoffman transform operation is the result of quantization performed by the quantization module, and the output of the Hoffman transform operation is JPEG image compression result data;
an image complexity evaluation module: evaluating the complexity of the image, inputting an original RAW image, outputting an image complexity index, and providing the image complexity index for a quantization coefficient selection module to select a quantization coefficient;
a quantization coefficient selection module: and selecting a quantization coefficient in the image quantization process, outputting the image quantization coefficient, and providing the image quantization coefficient for a quantization module to quantize the result of discrete cosine transform.
Wherein, the first and the second end of the pipe are connected with each other,
the DCT module, the quantization module and the Huffman transformation module are realized according to JPEG image compression standard.
The image complexity evaluation module may evaluate the complexity of the image by using a plurality of methods, for example, the variance of the image may be used as a characteristic value of the image complexity, which is:
the resolution of an input image img (m, n) is W × H, W is the image horizontal direction resolution, H is the image vertical direction resolution, 0-type (m) is less than or equal to W-1, and 0-type (n) is less than or equal to H-1. Variance of the image is
Where mean (img) is the average of the pixel gray values of the image. The gray value of the image is in the range of 0-2 N -1, where N is the number of bits used for single pixel storage of the image.
The evaluation of image complexity includes, but is not limited to, the above-described methods.
And the quantization coefficient selection module selects a quantization coefficient from the image quantization coefficient table according to the image complexity index output by the image complexity evaluation module. An image quantization coefficient selection method is:
s11, averagely dividing the image complexity index into ten grades of L1, L2, \8230 \ 8230;, L10, wherein L10 is the lowest complexity grade and represents that the image complexity is lower; l1 is the highest level of complexity and represents that the image complexity is high;
s12, defining 10 quantization tables of Q1, Q2, \8230;, Q10 according to the quantization degree, and sequentially reducing the image quantization degree from Q1 to Q10 as shown in the table 1. The quantization coefficients in the quantization table are similar to the divisor in the division, and under the condition that the dividend is constant, the larger the divisor is, the smaller the quantized result is, and the larger the quantization degree is.
TABLE 1 image quantization coefficient tables (a) - (j) correspond to quantization coefficient tables Q1-Q10, respectively
(a)
28 | 1C | 19 | 28 | 3C | 64 | 80 | 99 |
1E | 1E | 23 | 30 | 41 | 91 | 96 | 8A |
23 | 21 | 28 | 3C | 64 | 8F | AD | 8C |
23 | 2B | 37 | 49 | 80 | DA | C8 | 9B |
2D | 37 | 5D | 8C | AA | 111 | 102 | C1 |
3C | 58 | 8A | A0 | CB | 104 | 11B | E6 |
7B | A0 | C3 | DA | 102 | 12F | 12C | FD |
B4 | E6 | EE | F5 | 118 | FA | 102 | F8 |
(b)
1B | 12 | 11 | 1B | 28 | 43 | 55 | 66 |
14 | 14 | 17 | 20 | 2B | 61 | 64 | 5C |
17 | 16 | 1B | 28 | 43 | 5F | 73 | 5D |
17 | 1C | 25 | 30 | 55 | 91 | 85 | 67 |
1E | 25 | 3E | 5D | 71 | B6 | AC | 80 |
28 | 3A | 5C | 6B | 87 | AD | BC | 99 |
52 | 6B | 82 | 91 | AC | CA | C8 | A8 |
78 | 99 | 9E | A3 | BB | A7 | AC | A5 |
(c)
(d)
10 | B | A | 10 | 18 | 28 | 33 | 3D |
C | C | E | 13 | 1A | 3A | 3C | 37 |
E | D | 10 | 18 | 28 | 39 | 45 | 38 |
E | 11 | 16 | 1D | 33 | 57 | 50 | 3E |
12 | 16 | 25 | 38 | 44 | 6D | 67 | 4D |
18 | 23 | 37 | 40 | 51 | 68 | 71 | 5C |
31 | 40 | 4E | 57 | 67 | 79 | 78 | 65 |
48 | 5C | 5F | 62 | 70 | 64 | 67 | 63 |
(e)
D | 9 | 8 | D | 14 | 21 | 2B | 33 |
A | A | C | 10 | 16 | 30 | 32 | 2E |
C | B | D | 14 | 21 | 30 | 3A | 2F |
C | E | 12 | 18 | 2B | 49 | 43 | 34 |
F | 12 | 1F | 2F | 39 | 5B | 56 | 40 |
14 | 1D | 2E | 35 | 44 | 57 | 5E | 4D |
29 | 35 | 41 | 49 | 56 | 65 | 64 | 54 |
3C | 4D | 4F | 52 | 5D | 53 | 56 | 53 |
(f)
(g)
A | 7 | 6 | A | F | 19 | 20 | 26 |
8 | 8 | 9 | C | 10 | 24 | 26 | 22 |
9 | 8 | A | F | 19 | 24 | 2B | 23 |
9 | B | E | 12 | 20 | 36 | 32 | 27 |
B | E | 17 | 23 | 2B | 44 | 40 | 30 |
F | 16 | 22 | 28 | 33 | 41 | 47 | 3A |
1F | 28 | 31 | 36 | 40 | 4C | 4B | 3F |
2D | 3A | 3B | 3D | 46 | 3F | 40 | 3E |
(h)
9 | 6 | 6 | 9 | D | 16 | 1C | 22 |
7 | 7 | 8 | B | E | 20 | 21 | 1F |
8 | 7 | 9 | D | 16 | 20 | 26 | 1F |
8 | 9 | C | 10 | 1C | 30 | 2C | 22 |
A | C | 15 | 1F | 26 | 3D | 39 | 2B |
D | 13 | 1F | 24 | 2D | 3A | 3F | 33 |
1B | 24 | 2B | 30 | 39 | 43 | 43 | 38 |
28 | 33 | 35 | 36 | 3E | 38 | 39 | 37 |
(i)
(j)
And S13, selecting a quantization table according to the input image complexity level and the corresponding method of the figure 3. I.e. the corresponding quantization table Qi, i =1, 2, \8230, 10, is selected according to the complexity level Li of the image. After the quantization table is selected, the quantization table can be applied to perform quantization operation in jpeg standard, and quantization and subsequent operations such as huffman transform are specified in jpeg standard, and therefore are not specifically described. Using these quantization tables with successively lower quantization levels, the quantization levels for the images successively decrease, the sizes of the finally obtained compressed images successively increase, and the compression ratios achieved by jpeg compression successively decrease.
The method is applied to occasions needing to compress the original RAW image into the JPEG image. The invention has the advantages that the JPEG quantization coefficient is selected according to the self characteristics of the image in the continuous multi-frame image compression process, and the loss of image quality is reduced as much as possible while the image compression is realized.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.
Claims (10)
1. A JPEG image compression system is characterized by comprising a DCT module, a quantization module, a Huffman transformation module, an image complexity evaluation module and a quantization coefficient selection module;
a DCT module: the discrete cosine transform operation of the JPEG image compression standard is realized, the input of the discrete cosine transform operation is an original RAW image, and the output of the discrete cosine transform operation is the input of a quantization module;
a quantization module: the quantization operation of the JPEG image compression standard is realized, the input of the quantization operation is the result of discrete cosine transform performed by a DCT module, and the output of the quantization operation is the input of a Huffman transform module;
a Huffman conversion module: the Hoffman transform operation of the JPEG image compression standard is realized, the input of the Hoffman transform operation is the result of quantization performed by the quantization module, and the output of the Hoffman transform operation is JPEG image compression result data;
an image complexity evaluation module: evaluating the complexity of the image, inputting an original RAW image, outputting an image complexity index, and providing the image complexity index for a quantization coefficient selection module to select a quantization coefficient;
a quantization coefficient selection module: and selecting a quantization coefficient in the image quantization process, outputting the image quantization coefficient, and providing the image quantization coefficient for a quantization module to quantize a discrete cosine transform result.
2. The JPEG image compression system of claim 1 wherein the DCT module, the quantization module and the huffman transform module are implemented in accordance with a JPEG image compression standard.
3. The JPEG image compression system in accordance with claim 1, wherein the image complexity evaluation module uses the variance of the image as a characterizing value of the image complexity.
4. The JPEG image compression system as claimed in claim 3, characterized in that the resolution of the input image img (m, n) is W × H, W is the image horizontal direction resolution, H is the image vertical direction resolution, 0< -m > W-1,0< -n > H-1; variance of the image is
Wherein mean (img) is the pixel gray of the imageAn average of the values; the gray value of the image is in the range of 0-2 N -1, where N is the number of bits used for single pixel storage of the image.
5. The JPEG image compression system according to any of claims 1 to 4, characterized in that said quantization coefficient selection module selects a quantization coefficient in the image quantization process as follows:
s11, averagely dividing the image complexity index into ten grades of L1, L2, \8230;, L10;
s12, defining 10 quantization tables of Q1, Q2, 8230, 8230and Q10 according to the quantization degree;
and S13, selecting a corresponding quantization table according to the input image complexity level.
6. The JPEG image compression system in accordance with claim 5, wherein in said step S11, L10 is the complexity lowest level, which represents that the image complexity is low; l1 is the highest level of complexity, representing a higher image complexity.
7. The JPEG image compression system according to claim 6, characterized in that the image quantization degrees are sequentially reduced from Q1 to Q10 in said step S12.
8. The JPEG image compression system according to claim 7, wherein in the step S13, the corresponding quantization table Qi, i =1, 2, \8230, 10, is selected according to the complexity level Li of the image.
9. The JPEG image compression system in accordance with claim 8, further comprising after said step S13: after the quantization table is selected, the quantization table is applied to carry out quantization operation in the jpeg standard.
10. The JPEG image compression system as claimed in claim 9, wherein the quantization levels of the quantization tables are sequentially decreased, the quantization levels for the images are sequentially decreased, the sizes of the finally obtained compressed images are sequentially increased, and the compression ratios achieved by JPEG compression are sequentially decreased.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211326728.4A CN115695793A (en) | 2022-10-24 | 2022-10-24 | JPEG image compression system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211326728.4A CN115695793A (en) | 2022-10-24 | 2022-10-24 | JPEG image compression system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115695793A true CN115695793A (en) | 2023-02-03 |
Family
ID=85098742
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211326728.4A Pending CN115695793A (en) | 2022-10-24 | 2022-10-24 | JPEG image compression system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115695793A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116405574A (en) * | 2023-06-08 | 2023-07-07 | 中国人民解放军总医院第二医学中心 | Remote medical image optimization communication method and system |
-
2022
- 2022-10-24 CN CN202211326728.4A patent/CN115695793A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116405574A (en) * | 2023-06-08 | 2023-07-07 | 中国人民解放军总医院第二医学中心 | Remote medical image optimization communication method and system |
CN116405574B (en) * | 2023-06-08 | 2023-08-08 | 中国人民解放军总医院第二医学中心 | Remote medical image optimization communication method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6904175B2 (en) | Image compression using an interger reversible wavelet transform with a property of precision preservation | |
CN113810693B (en) | Lossless compression and decompression method, system and device for JPEG image | |
US8005306B2 (en) | Decoding apparatus, inverse quantization method, and computer readable medium | |
CN109324778B (en) | Compression method for compensation pressure | |
CN115695793A (en) | JPEG image compression system | |
CN103957426A (en) | RGB565 true color image lossy compression and decompression method | |
Sadkhan | A proposed image compression technique based on DWT and predictive techniques | |
CN104869426A (en) | JPEG coding method lowering image diamond effect under low compression code rate | |
CN102724381A (en) | Bill image compression method based on JPEG (joint photographic experts group) compression principle | |
T Hashim et al. | Color image compression using DPCM with DCT, DWT and quadtree coding scheme | |
CN115361556A (en) | High-efficiency video compression algorithm based on self-adaption and system thereof | |
Shportko et al. | Development of Predictors to Increase the Efficiency of Progressive Hierarchic Context-Independent Compression of Images Without Losses. | |
Khosla et al. | Design of Hybrid Compression Model using DWT-DCT-HUFFMAN Algorithms for Compression of Bit Stream | |
CN110737869B (en) | DCT/IDCT multiplier circuit optimization method and application | |
CN107645664B (en) | Color image compression method based on reaction-diffusion equation set | |
Elmourssi et al. | A Performance Study Of Two Jpeg Compression Approaches | |
CN105072446A (en) | Color image compression sampling and reconstruction algorithm | |
Li et al. | A video coding algorithm using vector-based techniques | |
Liu et al. | High-Imperceptibility Data Hiding Scheme for JPEG Images Based on Direction Modification. | |
CN109302614B (en) | Video compression method based on third-order tensor self-coding network | |
Bonyadi et al. | A non-uniform image compression using genetic algorithm | |
Roy et al. | VQ-DCT based image compression: a new hybrid approach | |
CN1186940C (en) | Improved cascaded compression method and system for digital video and images | |
CN112422964B (en) | Progressive coding method and device | |
Bonyadi et al. | A nonuniform high-quality image compression method to preserve user-specified compression ratio |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |