Color correction method and system

By generating a chromaticity correction matrix in the JPEG compressed image and performing chromaticity correction directly in the frequency domain, the problems of color information loss and color deviation are solved, lossless color correction is achieved, and the color fidelity and visual consistency of the compressed image are improved.

CN121334355APending Publication Date: 2026-01-13GONGQING INST OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511474160.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively address color information loss and color deviation caused by chroma component downsampling in JPEG compressed images, and traditional methods require decompression, leading to high computational complexity and color distortion.

Method used

By extracting the chromaticity quantization DCT coefficients of the compressed image, a chromaticity correction matrix is ​​generated, and chromaticity correction is performed directly in the frequency domain. Combining quantization table optimization and chromaticity statistical feature modeling, decompression processing is avoided, and a standard color chart calibration matrix is ​​used to provide a correction benchmark.

Benefits of technology

While maintaining compression efficiency, it accurately corrects chromaticity deviation, reduces blockiness and color distortion, and improves color fidelity, making it suitable for real-time image transmission systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121334355A_ABST
    Figure CN121334355A_ABST
Patent Text Reader

Abstract

The invention discloses a color correction method and system, and belongs to the technical field of image processing, and the method comprises the steps: extracting a chromaticity quantization DCT coefficient, an initial chromaticity quantization table and a standard color card calibration matrix of a compressed image; wherein the chroma quantization DCT coefficient comprises a DCT coefficient of a blue chroma component and a DCT coefficient of a red chroma component; generating a chromaticity correction matrix according to the DCT coefficient of the blue chromaticity component of the compressed image, the DCT coefficient of the red chromaticity component of the compressed image and the standard color card calibration matrix; correcting the frequency domain chromaticity of the compressed image according to the chromaticity correction matrix; generating a final chroma quantization DCT coefficient according to the initial chroma quantization table and the chroma correction matrix; outputting a compressed image code stream according to the final chromaticity quantization DCT coefficient and the entropy coding table; according to the method, chromaticity correction is directly carried out in the frequency domain of the compressed image, quantization table optimization and chromaticity statistical feature modeling are combined, the problems of calculation complexity and distortion caused by decompression processing are avoided, and the color fidelity of the compressed image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, and in particular relates to a color correction method and system. Background Technology

[0002] In the field of digital image processing, color correction is a crucial step in ensuring image quality. With the rapid development of digital imaging technology, image compression technology has been widely used in various scenarios. However, in compressed images, due to the introduction of the quantization process, chromaticity information often becomes distorted or deviated, severely affecting image quality.

[0003] Traditional color correction methods are primarily based on spatial domain adjustments, such as histogram equalization, white balance adjustment, or color matrix transformation. While these methods can improve image color performance to some extent, they have significant limitations: First, they typically require image decompression, which not only increases computational complexity but may also introduce new distortions during recompression; second, these methods struggle to effectively address the color information loss caused by chroma component downsampling during compression.

[0004] Furthermore, most existing frequency domain color correction techniques are designed for uncompressed images or specific encoding formats, making them difficult to apply directly to widely used compressed image formats such as JPEG. During JPEG compression, chroma components are typically downsampled and quantized, leading to the loss of high-frequency chroma information and causing problems such as color deviation and color block effects. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a color correction method and system that solves the aforementioned problems.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a color correction method, specifically comprising the following steps: Extract the colorimetric DCT coefficients, initial colorimetric table, and standard color chart calibration matrix of the compressed image; wherein, the colorimetric DCT coefficients include the DCT coefficients of the blue chromaticity component and the DCT coefficients of the red chromaticity component; A chromaticity correction matrix is ​​generated based on the DCT coefficients of the blue chromaticity component and the red chromaticity component of the compressed image and the standard color chart calibration matrix. The frequency domain chromaticity of the compressed image is corrected based on the chromaticity correction matrix; Based on the initial colorimetric table and colorimetric correction matrix, the final colorimetric DCT coefficients are generated. Based on the final chromaticity quantized DCT coefficients and entropy coding table, the compressed image bitstream is output.

[0007] Based on the above technical solutions, the present invention also provides the following optional technical solutions: Further technical solution: The specific method for generating the colorimetric correction matrix includes: Based on the DCT coefficients of the blue chromaticity component and the red chromaticity component, the average values ​​of the DCT coefficients of the blue chromaticity component and the average values ​​of the DCT coefficients of the red chromaticity component are generated respectively. A colorimetric correction analysis model is established based on the DCT coefficients of the blue chromaticity component, the DCT coefficients of the red chromaticity component, the average value of the DCT coefficients of the blue chromaticity component, the average value of the DCT coefficients of the red chromaticity component, and the standard color card calibration matrix, and a colorimetric correction matrix is ​​generated.

[0008] Further technical solution: The method for generating the average value of the DCT coefficients of the blue chromaticity component specifically includes: Through the formula: The average value of the DCT coefficients for generating the blue chromaticity component. ; In the formula, N is the number of DCT coefficients for the blue chromaticity component, and i is the quantity index. This represents the DCT coefficient of the i-th blue chromaticity component; Through the formula: The average value of the DCT coefficients for generating the red chromaticity component. ; In the formula, N represents the number of DCT coefficients for the red chromaticity component, and j is the quantity index. This represents the DCT coefficient of the j-th red chromaticity component.

[0009] Further technical solution: The expression of the colorimetric correction analysis model is specifically as follows: In the formula, This is the chromaticity correction matrix. This represents the DCT coefficient of the blue chromaticity component. This represents the DCT coefficients of the red chromaticity component. This represents the average DCT coefficients of all blue chromaticity components. This represents the average DCT coefficients of all red chromaticity components, and K represents the standard color chart calibration matrix. This is the chromaticity bias compensation vector. This is the Hadamard product operator.

[0010] Further technical solution: The step of generating final colorimetric DCT coefficients based on the initial colorimetric table and colorimetric correction matrix specifically includes: Based on the initial colorimetric table, generate the updated colorimetric table; Based on the updated colorimetric table and colorimetric correction matrix, the final colorimetric DCT coefficients are generated.

[0011] Further technical solution: The method for generating the updated colorimetric table specifically includes: Through the formula: Generate an updated color metric table ; In the formula, This represents the initial colorimetric table, where 'a' is the colorimetric enhancement intensity factor. The horizontal frequency weighting coefficient, For vertical frequency weighting coefficients, This represents the horizontal frequency coordinates of the DCT coefficients. This represents the vertical frequency coordinates of the DCT coefficients. This represents the frequency attenuation coefficient. It is a natural exponential function.

[0012] Further technical solution: The specific method for generating the final colorimetric quantized DCT coefficients includes: Through the formula: Generate the final colorimetric DCT coefficients ; In the formula, This is the chromaticity correction matrix. This is the updated color metric table.

[0013] Further technical solution: The step of outputting a compressed image bitstream based on the final chromaticity-quantized DCT coefficients and entropy coding table specifically includes: Based on the frequency position of the DCT coefficients in the final chromaticity quantization, the AC coefficients are divided into low-frequency bands and high-frequency bands; where AC coefficients refer to all coefficients in the DCT matrix except for DC coefficients, and DC coefficients are located in the upper left corner of the DCT matrix; For the non-zero AC coefficients in the low-frequency band, variable-length coding is used to generate Run-Level coded pairs of non-zero coefficients in the low-frequency band; For the AC coefficients of the high-frequency band, the stroke length of the continuous zero coefficients is directly calculated to generate the stroke length of the continuous zero coefficients of the high-frequency band. For the DC coefficients of each block, differential pulse code modulation is used to generate the differential DC coefficient value of the current block; A compressed image bitstream is generated based on the Run-Level coding pairs of non-zero coefficients in the low-frequency band, the run length of continuous zero coefficients in the high-frequency band, the DC coefficient difference value of the current block, and the entropy coding table.

[0014] Further technical solution: The method for generating the compressed image bitstream specifically includes: Through the formula: Generate compressed image bitstream ; In the formula, This represents the DC coefficient difference value of the current block, which refers to the DCT block being processed among all segmented DCT blocks in the compressed image. This represents the Run-Level coded pairs with non-zero coefficients in the low-frequency band. This is the sequence number of the current block. This represents the stroke length of the continuous zero coefficients in the high-frequency band, where h is the number of the continuous zero coefficient sequence.

[0015] A color correction system for performing the aforementioned color correction method, specifically comprising: The data extraction unit is used to extract the colorimetric DCT coefficients, the initial colorimetric table, and the standard color chart calibration matrix of the compressed image; wherein, the colorimetric DCT coefficients include the DCT coefficients of the blue chromaticity component and the DCT coefficients of the red chromaticity component. The colorimetric correction analysis unit is used to generate a colorimetric correction matrix based on the DCT coefficients of the blue colorimetric component and the red colorimetric component of the compressed image and the standard color chart calibration matrix. The chromaticity correction unit is used to correct the frequency domain chromaticity of the compressed image according to the chromaticity correction matrix; The final coefficient generation unit is used to generate the final colorimetric DCT coefficients based on the initial colorimetric table and the colorimetric correction matrix. The image bitstream generation unit is used to quantize the DCT coefficients and entropy coding table based on the final colorimetric data and output a compressed image bitstream.

[0016] This invention provides a color correction method and system, which has the following advantages compared with the prior art: This invention improves the color fidelity of compressed images by directly performing chromaticity correction in the frequency domain of the compressed image, combined with quantization table optimization and chromaticity statistical feature modeling, thus avoiding the computational complexity and distortion problems caused by decompression processing. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a color correction method provided by the present invention.

[0018] Figure 2 This is a schematic diagram of the structure of a color correction system provided by the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0020] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.

[0021] Please see Figure 1 The present invention provides a color correction method for compressed images, which specifically includes the following steps: Step S10: Extract the colorimetric DCT coefficients, initial colorimetric table, and standard color chart calibration matrix of the compressed image; wherein, the colorimetric DCT coefficients include the DCT coefficients of the blue chromaticity component and the DCT coefficients of the red chromaticity component. Step S20: Generate a chromaticity correction matrix based on the DCT coefficients of the blue chromaticity component and the red chromaticity component of the compressed image and the standard color chart calibration matrix; Step S30: Correct the frequency domain chromaticity of the compressed image according to the chromaticity correction matrix; Step S40: Generate the final colorimetric DCT coefficients based on the initial colorimetric table and colorimetric correction matrix; Step S50: Quantize the DCT coefficients and entropy coding table according to the final colorimetric parameters, and output the compressed image bitstream; Among them, the chromaticity quantization DCT coefficients refer to the frequency domain data of the chromaticity components after discrete cosine transform and quantization processing. Specifically, the quantization table can be obtained by parsing the header information of the compressed file, and the DCT coefficient matrix can be decoded from the compressed bitstream. It is used to characterize the frequency domain energy distribution of the compressed chromaticity components. The initial colorimetric quantization table refers to the original quantization step matrix used in the compression process. Specifically, it can use the JPEG standard quantization table or a custom quantization matrix. Its value determines the compression intensity of different frequency components. The standard color chart calibration matrix refers to the reference color space mapping relationship established based on the standard color chart image. Specifically, the ideal chromaticity value of each color block can be obtained by photographing the standard color chart, and a correction mapping relationship can be constructed with the measured chromaticity value to provide a reference for frequency domain correction.

[0022] Specifically, this method first extracts the frequency domain chromaticity components and quantization parameters directly from the compressed data, avoiding data loss caused by spatial domain conversion. By analyzing the DCT coefficient distribution characteristics of the blue and red components and combining them with a color reference established using a standard color chart, a frequency domain correction matrix is ​​constructed to compensate for chromaticity deviations. During the correction process, the core compression characteristics of the quantization table are maintained, and the degree of high-frequency component retention is optimized by dynamically adjusting the quantization step size distribution. The final output compressed bitstream directly inherits the original entropy coding structure, ensuring that the corrected image meets the requirements of the standard compression format.

[0023] Compared to existing technologies, traditional methods require fully decoding the compressed image to the pixel domain for color adjustment. This method directly manipulates the DCT coefficients in the frequency domain, eliminating the computational overhead of repeated encoding and decoding. Existing frequency domain correction techniques often employ fixed quantization tables; this method, through a dynamic quantization table update mechanism, improves the accuracy of chrominance components while maintaining compression ratio. Compared to common methods based on downsampling chrominance processing, this method utilizes a standard color chart calibration matrix to establish a precise correction benchmark, effectively solving the problem of coupling distortion between chrominance components.

[0024] Through the above technical solution, this application achieves lossless frequency domain color correction processing for compressed images, accurately correcting chromaticity deviations while maintaining the original compression efficiency. The processing avoids data loss and computational delays caused by decompression operations, and can be directly applied to real-time image transmission systems. The collaborative optimization mechanism of the quantization table and correction matrix not only preserves the effective compression of high-frequency chromaticity information but also compensates for quantization errors through frequency domain coefficient adjustment, significantly reducing block artifacts and color distortion.

[0025] Preferably, the present invention further proposes a method for generating the chromaticity correction matrix, specifically including: Step S21: Based on the DCT coefficients of the blue chromaticity component and the red chromaticity component, generate the average value of the DCT coefficients of the blue chromaticity component and the average value of the DCT coefficients of the red chromaticity component, respectively. Step S22: Establish a colorimetric correction analysis model based on the DCT coefficients of the blue chromaticity component, the DCT coefficients of the red chromaticity component, the average value of the DCT coefficients of the blue chromaticity component, the average value of the DCT coefficients of the red chromaticity component, and the standard color card calibration matrix, and generate a colorimetric correction matrix. The average value of the DCT coefficients of the blue chromaticity component refers to the statistical center value of the blue component DCT coefficients calculated by arithmetic mean. Specifically, it can be achieved by summing all the blue component DCT coefficients and dividing by the number of data points, which is used to eliminate random fluctuations of individual coefficients. The average value of the DCT coefficients of the red chromaticity component refers to the statistical benchmark value of the red component calculated using the same method, which is used to reflect the overall distribution characteristics of the chromaticity component. The standard color chart calibration matrix is ​​a predefined matrix containing standard colorimetric information. Specifically, it can be generated using the DCT coefficient mapping relationship of known standard color charts under the same compression conditions, and is used to provide a reference benchmark in the calibration process. The colorimetric correction analysis model refers to the mathematical relationship between DCT coefficients, statistical averages, and standard color card information. Specifically, it can be implemented by combining Hadamard product operations and bias compensation vectors to distinguish between systematic errors and random noise.

[0026] Specifically, the DCT coefficients of the blue and red chromaticity components are first arithmetically averaged to obtain statistical baseline values ​​reflecting the overall distribution characteristics. Then, the difference between the original DCT coefficients and their corresponding average values ​​is calculated to eliminate the influence of random noise on the chromaticity components. By performing a Hadamard product operation between the difference result and the standard color chart calibration matrix, targeted adjustments to the chromaticity components are achieved, while a bias compensation vector is introduced to correct the chromaticity offset. This process compares the actual chromaticity distribution of the compressed image with the standard color chart information, directly correcting systematic errors in the frequency domain without requiring image decompression.

[0027] Compared to existing technologies, traditional frequency domain correction methods typically perform linear transformations on the DCT coefficients directly, neglecting the statistical distribution characteristics of chromaticity components, making the correction matrix susceptible to noise interference. Existing technologies using fixed weight matrices cannot adapt to chromaticity deviations under different compression conditions, and the lack of standard color chart information renders the correction process without an objective benchmark. This solution introduces a statistical average to establish a dynamic benchmark, combining it with a standard color chart calibration matrix to achieve adaptive correction, effectively distinguishing between the effects of systematic color shifts and random noise.

[0028] Through the above technical solution, this application solves the problem of inaccurate correction matrix caused by the lack of statistical characteristic modeling in traditional methods. It uses the average value calculation to eliminate random noise interference and provides an objective correction benchmark through the standard color card calibration matrix, so that the generated color correction matrix can accurately reflect the actual color deviation of the compressed image, thereby directly completing color correction in the frequency domain and avoiding the distortion risk introduced by the decompression and recompression process.

[0029] Preferably, the present invention further proposes a method for generating the average value of the DCT coefficients of the blue chromaticity component, specifically including: Through the formula: The average value of the DCT coefficients for generating the blue chromaticity component. ; In the formula, N is the number of DCT coefficients for the blue chromaticity component, and i is the quantity index. This represents the DCT coefficient of the i-th blue chromaticity component; Through the formula: The average value of the DCT coefficients for generating the red chromaticity component. ; In the formula, N represents the number of DCT coefficients for the red chromaticity component, and j is the quantity index. This represents the DCT coefficient of the j-th red chromaticity component; The number of DCT coefficients N for the blue chromaticity component refers to the total number of DCT coefficients corresponding to the blue chromaticity component in all DCT blocks of the compressed image. Specifically, it can be achieved by traversing the chromaticity component data of each DCT block in the compressed image and counting the number. This parameter is used to determine the sample size for calculating the average value. The number of DCT coefficients M for the red chroma component refers to the total number of DCT coefficients corresponding to the red chroma component in all DCT blocks of the compressed image. Specifically, it can be achieved by traversing the chroma component data of each DCT block in the compressed image and counting the number. This parameter is used to ensure the completeness of the red component statistics. The DCT coefficient Q of the i-th blue chromaticity component cb,i It refers to the quantized DCT coefficient of the blue chroma component in the i-th DCT block of the compressed image. Specifically, it can be achieved by parsing the chroma component data in the compressed image bitstream and extracting the coefficient values ​​at the corresponding positions. This parameter is used to reflect the frequency domain characteristics of the local chroma component. The DCT coefficient Q of the j-th red chromaticity component cr,j This refers to the quantized DCT coefficient of the red chroma component within the j-th DCT block of the compressed image. Specifically, it can be achieved by parsing the chroma component data in the compressed image bitstream and extracting the coefficient values ​​at the corresponding positions. This parameter is used to characterize the frequency domain distribution characteristics of the red component.

[0030] Specifically, by traversing the chromaticity component data of all DCT blocks in the compressed image, the sum of the DCT coefficients for the blue and red components is calculated separately, and then divided by the corresponding data quantities N and M to obtain the arithmetic mean. This average value reflects the overall distribution center of the chromaticity components in the frequency domain, and can eliminate coefficient fluctuations caused by quantization errors or local color deviations within a single DCT block. In the subsequent chromaticity correction analysis model, by calculating the difference between each DCT coefficient and the average value of its corresponding component, abnormal coefficients that deviate from the overall distribution can be effectively separated, thus providing standardized input for the generation of the chromaticity correction matrix.

[0031] Compared to existing technologies, traditional methods in frequency domain color correction typically use the original DCT coefficients directly for calculations, without considering the statistical distribution differences of different chromaticity components, making the correction model sensitive to local noise. This proposed solution, however, introduces the calculation of the average value of the chromaticity components to establish benchmark parameters based on global statistical characteristics. This allows chromaticity correction to compensate for deviations based on overall distribution features, reducing the impact of local outliers on the correction results.

[0032] Through the above technical solution, this application solves the problem of error accumulation caused by the lack of statistical characteristic modeling of chromaticity components in compressed image color correction. It provides stable reference parameters for chromaticity correction by calculating the global average value, thereby improving the accuracy and robustness of color correction, while avoiding additional computational complexity.

[0033] Preferably, the present invention further proposes the following expression for the colorimetric correction analysis model: In the formula, This is the chromaticity correction matrix. This represents the DCT coefficient of the blue chromaticity component. This represents the DCT coefficients of the red chromaticity component. This represents the average DCT coefficients of all blue chromaticity components. This represents the average DCT coefficients of all red chromaticity components, and K represents the standard color chart calibration matrix. This is the chromaticity bias compensation vector. This is the Hadamard product operator; Among them, the standard color card calibration matrix refers to the colorimetric reference matrix pre-calibrated in the DCT domain based on the standard color card. Specifically, it can be generated by extracting the colorimetric component coefficients after DCT transformation and quantization of the standard color card image, and is used to provide a colorimetric reference for the calibration process. Hadamard product operator This refers to the operation rule of multiplying corresponding elements of a matrix. Specifically, it can be achieved by multiplying the standard color card calibration matrix and the color deviation ratio matrix element by element, so that the color reference of the calibration matrix is ​​dynamically adapted to the color statistical distribution of the current image. The chromaticity bias compensation vector refers to the compensation parameter used to adjust the residual color difference after correction. Specifically, it can be generated by performing error analysis on the corrected chromaticity matrix, for example, by using the least squares method to optimize and obtain the compensation value.

[0034] Specifically, by calculating the ratio of the deviations of the DCT coefficients of the blue and red chromaticity components to their respective average values, the overall shift of the chromaticity components caused by quantization is eliminated, while retaining relative color difference information. A Hadamard product is then performed between the standard color chart calibration matrix and the deviation ratio, dynamically adapting the chromaticity reference of the calibration matrix to the chromaticity statistical distribution of the current image, avoiding calibration errors introduced by direct linear superposition. Finally, the correction results are fine-tuned using a chromaticity bias compensation vector to compensate for residual color shifts caused by loss of high-frequency information or differences in the quantization table. This process simultaneously achieves chromaticity statistical characteristic analysis, dynamic adaptation of the calibration matrix, and residual error compensation in the frequency domain.

[0035] Compared to existing technologies, traditional frequency domain correction methods typically apply a fixed calibration matrix directly for linear transformation, neglecting the statistical distribution characteristics of chromaticity components, leading to a mismatch between the calibration reference and the actual chromaticity of the image. This proposed solution, however, introduces the calculation of the average deviation of chromaticity components, dynamically adjusts the weight distribution of the calibration matrix, and combines this with Hadamard product operations to fuse the calibration reference with statistical characteristics. Furthermore, a compensation vector is used to further eliminate systematic errors, thereby improving correction accuracy.

[0036] Through the above technical solution, this application solves the problem of insufficient accuracy caused by the disconnect between the calibration matrix and the chromaticity statistical characteristics in frequency domain color correction, realizes dynamic reference adaptation and residual error compensation of chromaticity components of compressed images, and effectively improves the color shift phenomenon caused by quantization distortion and calibration deviation.

[0037] Preferably, the present invention further proposes the method of generating the final colorimetric DCT coefficients based on the initial colorimetric table and the colorimetric correction matrix, specifically including: Step S41: Generate an updated colorimetric table based on the initial colorimetric table; Step S42: Generate the final colorimetric DCT coefficients based on the updated colorimetric table and colorimetric correction matrix; The initial chromaticity quantization table refers to the initial parameter table used for quantizing the discrete cosine transform coefficients of the chromaticity components during the compression coding process. Specifically, it can be implemented using a frequency-aware dynamic adjustment method, such as nonlinearly scaling the quantization step size by introducing a frequency weighting coefficient. The updated colorimetric quantization table refers to a quantization parameter table optimized by frequency response. Specifically, it can be achieved by adjusting the quantization weights of different frequency components, such as by combining an exponential decay function to compensate for the quantization step size of high-frequency components. The chromaticity correction matrix refers to the frequency domain correction parameters generated by the statistical characteristics of chromaticity components and the standard color card calibration. Specifically, it can be implemented by combining Hadamard product operation and bias compensation. The final chromaticity quantization DCT coefficients refer to the frequency domain coefficients of the chromaticity components after quantization table optimization and correction matrix fusion. Specifically, the corrected chromaticity components can be matched with the updated quantization table through matrix division.

[0038] Specifically, in image compression processing, the initial chromaticity quantization table may not be suitable for the corrected chromaticity component distribution characteristics. By introducing frequency weighting coefficients and attenuation functions, the quantization step size at different frequency positions in the initial quantization table is dynamically adjusted. For example, higher frequency components in the horizontal and vertical directions can use smaller quantization step sizes to preserve detail information. The updated chromaticity quantization table and the chromaticity correction matrix are fused through mathematical operations, such as dividing the adjusted chromaticity component values ​​in the correction matrix by the optimized quantization parameters, so that the corrected chromaticity components can achieve an accurate match with the quantization table. This step-by-step processing mechanism avoids chromaticity distortion caused by directly using the initial quantization table and reduces the loss of high-frequency chromaticity information through dynamic optimization of quantization parameters.

[0039] Compared to existing technologies, traditional methods typically use a fixed quantization table for chromaticity component processing, leading to a mismatch between the corrected chromaticity components and the quantization parameters. This solution, through a dynamic update mechanism for the quantization table, adaptively adjusts the quantization parameters based on the chromaticity correction results. For example, it uses a finer quantization step size in high-frequency regions to maintain smooth color transitions. In existing technologies, quantization table optimization and color correction are usually performed independently, while this solution achieves joint optimization of quantization parameters and the correction matrix through staged collaborative processing, effectively resolving the conflict between chromaticity distortion and compression efficiency.

[0040] Through the above technical solutions, this application can reduce the quantization error of chroma components while maintaining the compression bitrate. For example, the optimized quantization table can reduce the rounding error amplitude of high-frequency chroma components. Simultaneously, the coordinated processing of the correction matrix and the quantization table can avoid the cumulative error caused by multiple quantization operations, such as maintaining the frequency domain consistency of chroma components during JPEG recompression. This solution also improves the compatibility between the color correction process and compression coding; for example, the optimized quantization table can be directly applied to the entropy coding stage without additional conversion processing.

[0041] Preferably, the present invention further proposes a method for generating the updated colorimetric table, specifically including: Through the formula: Generate an updated color metric table ; In the formula, This represents the initial colorimetric table, where 'a' is the colorimetric enhancement intensity factor. The horizontal frequency weighting coefficient, For vertical frequency weighting coefficients, This represents the horizontal frequency coordinates of the DCT coefficients. This represents the vertical frequency coordinates of the DCT coefficients. This represents the frequency attenuation coefficient. It is a natural exponential function; Among them, the initial colorimetric table It refers to the preset quantization matrix used for DCT coefficient quantization of chrominance components in the JPEG compression standard. Specifically, the chrominance quantization table recommended by the JPEG standard can be used as the initial value. The quantization accuracy of different frequency components can be changed by adjusting the value of the table. The chromaticity enhancement intensity factor 'a' refers to the proportional coefficient that controls the adjustment range of the quantization table. Specifically, it can be an empirical value or a value dynamically calculated based on the local chromaticity variance of the image. It is used to adaptively adjust the retention intensity of high-frequency components according to the image content. Horizontal frequency weighting coefficient and vertical frequency weighting coefficient It refers to the weighting parameters that act on the horizontal and vertical frequency components of the DCT coefficients respectively. Specifically, they can be empirical values ​​or optimized parameters obtained through training, and are used to distinguish the importance of high-frequency components in different directions. Frequency attenuation coefficient It refers to the parameter that controls the spread of the influence range of the frequency. Specifically, it can be set using empirical values ​​or the standard deviation of a Gaussian distribution, and is used to adjust the rate at which the quantization step size decreases as the frequency increases.

[0042] Specifically, this technical solution dynamically optimizes the quantization step size of the chromaticity component in the frequency domain by constructing a frequency-sensitive quantization table adjustment function. The exponential term in the formula... A spatial attenuation factor is generated based on the horizontal and vertical frequency coordinates of the DCT coefficients. This factor, along with the chromaticity enhancement intensity factor, acts on the initial quantization table. In the high-frequency region, the exponent term decreases as the frequency coordinate increases, leading to an overall decrease in the denominator term. This results in a smaller updated quantization table value, thereby reducing the quantization step size of high-frequency components and minimizing information loss. In the low-frequency region, the exponent term approaches zero, and the denominator term approaches 1, maintaining the quantization table value in its initial state to preserve compression efficiency. The horizontal and vertical frequency weighting coefficients can independently adjust the attenuation amplitude of frequency components in different directions. For example, increasing the horizontal weighting coefficient results in a more significant reduction in the quantization step size of horizontal high-frequency components. The frequency attenuation coefficient controls the steepness of the attenuation function; a smaller value makes the quantization step size adjustment range more concentrated in the high-frequency region.

[0043] Compared to existing technologies, traditional methods use fixed chromaticity quantization tables for compression, which cannot adjust quantization precision according to frequency component characteristics, leading to loss of high-frequency chromaticity information and chromaticity deviation. This solution establishes a dynamic adjustment mechanism for the quantization table in the frequency domain, adaptively adjusting the quantization step size for different frequency components, thus maintaining compression efficiency in the low-frequency region while preserving high-frequency chromaticity details. Existing technologies often optimize quantization tables based on global statistical characteristics, while this solution introduces a frequency-coordinate-dependent attenuation function to achieve spatially adaptive quantization table updates.

[0044] Through the above technical solutions, this application effectively reduces the quantization distortion of high-frequency chromaticity components in compressed images and solves the problem of chromaticity information loss caused by fixed quantization tables; through a frequency-sensitive quantization step size adjustment mechanism, a dynamic balance between chromaticity fidelity and compression efficiency is achieved; by independently adjusting the weight coefficients in the horizontal and vertical directions, the retention intensity of high-frequency components in different directions can be optimized for image content, thereby improving the accuracy of color correction.

[0045] Preferably, the present invention further proposes a method for generating the final colorimetric quantized DCT coefficients, specifically including: Through the formula: Generate the final colorimetric DCT coefficients ; In the formula, This is the chromaticity correction matrix. For the updated color metric table; Among them, the chromaticity correction matrix refers to the chromaticity component distribution characteristic matrix after frequency domain chromaticity correction. Specifically, it can be calculated by combining the DCT coefficients of the blue chromaticity component and the red chromaticity component with the standard color card calibration matrix. Its function is to map the corrected chromaticity information to the quantization domain in matrix form. The updated colorimetric table refers to the quantization step size table optimized by the frequency-weighted attenuation function. Specifically, it can be generated by combining the initial colorimetric table with the horizontal frequency weighting coefficient, the vertical frequency weighting coefficient, and the frequency attenuation coefficient. Its function is to achieve high-frequency noise suppression and low-frequency detail preservation by adjusting the quantization step size of different frequency components.

[0046] Specifically, by dividing the chroma correction matrix by the updated chroma quantization table, the final chroma quantization DCT coefficients that meet the requirements of compressed coding are directly generated. This operation combines the corrected chroma component distribution characteristics with a frequency-adaptive quantization step size, so that the coding accuracy in high-frequency regions decreases due to the increased quantization step size, while more details are preserved in low-frequency regions due to the decreased quantization step size. This process does not require decompression and requantization of the image, avoiding the error accumulation problem caused by multiple quantizations in traditional methods. At the same time, the frequency weight parameters of the quantization table dynamically balance color fidelity and compression efficiency.

[0047] Compared to existing technologies, traditional methods require re-performing DCT transform and quantization operations after color correction in the spatial domain, leading to the superposition of repeated quantization errors in high-frequency components. This solution eliminates intermediate processing steps by directly fusing the correction matrix and optimized quantization table in the frequency domain. This maintains the frequency domain characteristics of the corrected chromaticity components while suppressing noise through the frequency attenuation function of the quantization table, thus simultaneously completing color correction and compression optimization in a single quantization process.

[0048] Through the above technical solution, this application can directly generate color quantization coefficients that conform to the compression coding standard in the frequency domain, avoiding color distortion caused by repeated quantization. At the same time, through the frequency adaptive quantization step size adjustment mechanism, high-frequency noise is effectively suppressed while ensuring the accuracy of low-frequency color detail, thereby improving the color reproduction quality and visual consistency of compressed images.

[0049] Preferably, the present invention further proposes the step of outputting a compressed image bitstream based on the final chromaticity quantized DCT coefficients and entropy coding table, specifically including: Step S51: Based on the frequency position of the final chromatic DCT coefficients, divide the AC coefficients into low-frequency bands and high-frequency bands; where AC coefficients refer to all coefficients in the DCT matrix except for DC coefficients, and DC coefficients are located in the upper left corner of the DCT matrix. Step S52: For the non-zero AC coefficients in the low frequency band, use variable-length coding to generate Run-Level coded pairs of non-zero coefficients in the low frequency band; Step S53: For the AC coefficients of the high-frequency band, directly calculate the stroke length of the continuous zero coefficients to generate the stroke length of the continuous zero coefficients of the high-frequency band. Step S54: For the DC coefficients of each block, differential pulse code modulation is used to generate the DC coefficient differential value of the current block; Step S55: Generate a compressed image bitstream based on the Run-Level coding pairs of non-zero coefficients in the low-frequency band, the run length of the continuous zero coefficients in the high-frequency band, the DC coefficient difference value of the current block, and the entropy coding table; Among them, the AC coefficients refer to all the coefficients in the DCT matrix except for the DC coefficient in the upper left corner. Specifically, they can be realized by removing the DC component from the coefficient matrix after discrete cosine transform, and are used to characterize the high-frequency detail information of the image. The low-frequency band refers to the low-frequency region near the upper left corner of the DCT coefficient matrix. Specifically, it can be achieved by setting a frequency threshold or dividing a fixed area. This region contains the main chromaticity information with concentrated energy. The high-frequency band refers to the high-frequency region in the DCT coefficient matrix that is far from the upper left corner. Specifically, it can be divided by the sum of the squares of the frequency coordinates being greater than a preset threshold. This region contains sparsely distributed detailed information. Run-Level coding pairs refer to tuples consisting of zero-coefficient run lengths and non-zero coefficient values. Specifically, Huffman coding or arithmetic coding can be used to compress the low-frequency non-zero coefficients to efficiently represent the distribution characteristics of low-frequency components. The stroke length refers to the number of consecutive zero coefficients, which can be achieved by traversing the high-frequency band coefficients and counting the sequence of consecutive zero values, in order to eliminate data redundancy in the high-frequency region. Differential pulse code modulation refers to encoding by the difference in DC coefficients between adjacent blocks. Specifically, the DC value of the previous block can be used as the prediction value to calculate the difference of the current block, which is used to reduce the spatial redundancy of the DC component.

[0050] Specifically, by dividing AC coefficients into low-frequency and high-frequency bands according to frequency, a differentiated coding strategy is adopted for the statistical characteristics of different frequency bands. For low-frequency non-zero AC coefficients, variable-length coding is used to generate run-level coded pairs, preserving the corrected key chromaticity information and avoiding the spread of low-frequency quantization errors. For high-frequency AC coefficients, the run length of consecutive zero coefficients is directly calculated, and redundant data is compressed using the energy attenuation characteristics of the high-frequency region. Differential coding is used for DC coefficients to eliminate spatial correlation between adjacent blocks. Finally, the three types of coded data are integrated into a compact bitstream by combining an entropy coding table, achieving efficient expression of chromaticity information within the compression domain and avoiding the computational burden and secondary distortion caused by decompression and recompression.

[0051] Compared to existing technologies, traditional methods typically employ run-level coding for all AC coefficients across the entire frequency band, resulting in redundant code lengths in the high-frequency region due to an excessive number of zero coefficients. Furthermore, the spatial redundancy coding of DC coefficients remains unoptimized. This proposed solution utilizes a frequency-band processing strategy, replacing the traditional coding mode with run-length statistics for the high-frequency band, thus reducing invalid data usage. A differential coding mechanism is introduced for the DC coefficients to further reduce the bit rate. Compared to a uniform coding approach, this method significantly improves compression efficiency while maintaining color correction accuracy.

[0052] Through the above technical solution, this application effectively solves the problems of chromatic distortion and color block effect caused by the loss of high-frequency information during the color correction process of compressed images. By reducing the amount of high-frequency redundant data through frequency band coding strategy, the coding complexity is reduced. At the same time, the computational resource consumption and secondary quantization error caused by decompression and recompression operations are avoided, and the synergistic optimization of chromatic correction and efficient coding is directly realized in the compression domain.

[0053] Preferably, the present invention further proposes a method for generating the compressed image bitstream, specifically including: Through the formula: Generate compressed image bitstream ; In the formula, This represents the DC coefficient difference value of the current block, which refers to the DCT block being processed among all segmented DCT blocks in the compressed image. This represents the Run-Level coded pairs with non-zero coefficients in the low-frequency band. This is the sequence number of the current block. This represents the stroke length of a continuous zero coefficient in the high-frequency band, where h is the number of the continuous zero coefficient sequence; in, It refers to the DC coefficient difference value of the current block, which can be calculated by the difference of the DC values ​​of adjacent blocks, and is used to eliminate spatial redundancy; It refers to the Run-Level encoding pair of non-zero coefficients in the low-frequency band. Specifically, it can be achieved by recording the combination of the number of zero values ​​before the non-zero coefficient and the amplitude of the current non-zero coefficient, and is used to compress sparsely distributed low-frequency data. It refers to the stroke length of continuous zero coefficients in the high-frequency band, which can be achieved by counting the number of continuous zero values, and is used to reduce the amount of data in the high-frequency region; Entropy coding function This refers to an encoding method that converts input parameters into a compressed bitstream. Specifically, it can be implemented using Huffman coding or arithmetic coding to improve encoding efficiency.

[0054] Specifically, in the process of generating compressed image bitstreams, the AC coefficients of the DCT block are first divided into low-frequency and high-frequency bands. For non-zero AC coefficients in the low-frequency band, their position and amplitude are recorded using run-level coding, such as the combination of the number of zero values ​​preceding the non-zero coefficient and the current coefficient value, thereby effectively compressing sparsely distributed low-frequency information. For AC coefficients in the high-frequency band, the run length of consecutive zero coefficients is directly counted, for example, merging consecutively occurring zero values ​​into a single count value, avoiding bit-by-bit encoding of high-frequency zero values. For the DC coefficients of each block, differential pulse code modulation is used, for example, calculating the difference in DC values ​​between the current block and the previous block, utilizing the correlation between adjacent blocks to reduce the number of encoded bits. Finally, the above parameters are input into the entropy coding function, generating a compact compressed bitstream according to a predefined entropy coding table. Through frequency band differentiation processing, detailed information is preserved in the low-frequency band, zero-value encoding is simplified in the high-frequency band, and combined with DC differential coding, overall data redundancy is reduced.

[0055] In some specific implementations, the low-frequency band can be defined as the upper left region of the DCT matrix, such as the first 3×3 or 4×4 coefficients; the high-frequency band can be defined as the lower right region of the DCT matrix, such as coefficients exceeding a 5×5 range. The Run value in the Run-Level coding pair can be represented by binary variable-length coding, and the Level value can be mapped using a quantized amplitude coding table. The high-frequency band run length can be encoded using a fixed bit width or an adaptive bit width, for example, dynamically adjusting the bit width allocation based on image statistical characteristics.

[0056] Compared to existing technologies, traditional compression coding methods fail to distinguish the statistical differences between low-frequency and high-frequency bands, applying a uniform run-level coding to all AC coefficients, resulting in redundant zero-value coding in high-frequency regions. For example, the JPEG standard uses a single Zig-Zag scan and run-level coding for all AC coefficients, without optimizing for the dense zero-value characteristics in high-frequency regions. This scheme employs frequency band processing, calculating only the zero-value run length in the high-frequency band to reduce the number of coding symbols; while retaining run-level coding in the low-frequency band to maintain detail accuracy, thereby reducing the bitstream size while ensuring image quality. Furthermore, DC differential coding further utilizes spatial correlation, reducing bit consumption compared to absolute value coding.

[0057] Through the above technical solution, this application effectively solves the problem of high data redundancy in compressed image bitstreams. By employing a frequency-band differentiated coding strategy, key information is retained in the low-frequency band, while zero-value representation is simplified in the high-frequency band. Combined with DC differential coding, coding efficiency is significantly improved. Furthermore, this solution requires no modification to the compression framework structure and can be directly integrated into existing entropy coding modules, ensuring compatibility with standard formats such as JPEG. It reduces storage and transmission overhead while maintaining image color fidelity.

[0058] Please see Figure 2The present invention further proposes a color correction system for performing the aforementioned color correction method, specifically including: The data extraction unit 10 is used to extract the colorimetric DCT coefficients, the initial colorimetric table, and the standard color chart calibration matrix of the compressed image; wherein, the colorimetric DCT coefficients include the DCT coefficients of the blue chromaticity component and the DCT coefficients of the red chromaticity component. The colorimetric correction analysis unit 20 is used to generate a colorimetric correction matrix based on the DCT coefficients of the blue colorimetric component and the red colorimetric component of the compressed image and the standard color chart calibration matrix. The chromaticity correction unit 30 is used to correct the frequency domain chromaticity of the compressed image according to the chromaticity correction matrix; The final coefficient generation unit 40 is used to generate the final colorimetric DCT coefficients based on the initial colorimetric table and the colorimetric correction matrix. The image bitstream generation unit 50 is used to quantize the DCT coefficients and entropy coding table based on the final colorimetric data and output a compressed image bitstream.

[0059] Preferably, the present invention further proposes that the colorimetric correction analysis unit 20 specifically includes: The mean generation module is used to generate the average value of the DCT coefficients of the blue chromaticity component and the average value of the DCT coefficients of the red chromaticity component, respectively, based on the DCT coefficients of the blue chromaticity component and the red chromaticity component. The colorimetric correction matrix generation module is used to establish a colorimetric correction analysis model and generate a colorimetric correction matrix based on the DCT coefficients of the blue colorimetric component, the DCT coefficients of the red colorimetric component, the average value of the DCT coefficients of the blue colorimetric component, the average value of the DCT coefficients of the red colorimetric component, and the standard color card calibration matrix.

[0060] Preferably, the present invention further proposes that the final coefficient generation unit 40 specifically includes: The quantization table update module is used to generate an updated quantization table based on the initial quantization table. The final coefficient output module is used to generate the final colorimetric DCT coefficients based on the updated colorimetric table and colorimetric correction matrix.

[0061] Preferably, the present invention further proposes that the image stream generation unit 50 specifically includes: The classification module is used to divide the AC coefficients into low-frequency bands and high-frequency bands based on the frequency position of the DCT coefficients in the final colorimetric quantization. Here, the AC coefficients refer to all other coefficients in the DCT matrix except for the DC coefficients, and the DC coefficients are located in the upper left corner of the DCT matrix. The low-frequency processing module is used to generate Run-Level encoded pairs of non-zero AC coefficients in the low-frequency band using variable-length encoding. The high-frequency processing module is used to directly calculate the stroke length of continuous zero coefficients in the AC coefficient of the high-frequency band and generate the stroke length of continuous zero coefficients in the high-frequency band. The differential value generation module is used to generate the DC coefficient differential value of the current block by using differential pulse code modulation on the DC coefficient of each block. The bitstream output module is used to generate a compressed image bitstream based on the Run-Level coding pairs of non-zero coefficients in the low-frequency band, the run length of the continuous zero coefficients in the high-frequency band, the DC coefficient difference value of the current block, and the entropy coding table.

[0062] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A color correction method applied to compressed images, characterized in that, Specifically, the following steps are included: Extract the colorimetric DCT coefficients, initial colorimetric table, and standard color chart calibration matrix of the compressed image; wherein, the colorimetric DCT coefficients include the DCT coefficients of the blue chromaticity component and the DCT coefficients of the red chromaticity component; A chromaticity correction matrix is ​​generated based on the DCT coefficients of the blue chromaticity component and the red chromaticity component of the compressed image and the standard color chart calibration matrix. The frequency domain chromaticity of the compressed image is corrected based on the chromaticity correction matrix; Based on the initial colorimetric table and colorimetric correction matrix, the final colorimetric DCT coefficients are generated. Based on the final chromaticity quantized DCT coefficients and entropy coding table, the compressed image bitstream is output.

2. The color correction method according to claim 1, characterized in that, The specific methods for generating the colorimetric correction matrix include: Based on the DCT coefficients of the blue chromaticity component and the red chromaticity component, the average values ​​of the DCT coefficients of the blue chromaticity component and the average values ​​of the DCT coefficients of the red chromaticity component are generated respectively. A colorimetric correction analysis model is established based on the DCT coefficients of the blue chromaticity component, the DCT coefficients of the red chromaticity component, the average value of the DCT coefficients of the blue chromaticity component, the average value of the DCT coefficients of the red chromaticity component, and the standard color card calibration matrix, and a colorimetric correction matrix is ​​generated.

3. The color correction method according to claim 2, characterized in that, The method for generating the average value of the DCT coefficients of the blue chromaticity component specifically includes: Through the formula: The average value of the DCT coefficients for generating the blue chromaticity component. ; In the formula, N is the number of DCT coefficients for the blue chromaticity component, and i is the quantity index. This represents the DCT coefficient of the i-th blue chromaticity component; Through the formula: The average value of the DCT coefficients for generating the red chromaticity component. ; In the formula, N represents the number of DCT coefficients for the red chromaticity component, and j is the quantity index. This represents the DCT coefficient of the j-th red chromaticity component.

4. The color correction method according to claim 2, characterized in that, The specific expression of the colorimetric correction analysis model is as follows: In the formula, This is the chromaticity correction matrix. This represents the DCT coefficient of the blue chromaticity component. This represents the DCT coefficients of the red chromaticity component. This represents the average DCT coefficients of all blue chromaticity components. This represents the average DCT coefficients of all red chromaticity components, and K represents the standard color chart calibration matrix. This is the chromaticity bias compensation vector. This is the Hadamard product operator.

5. The color correction method according to claim 1, characterized in that, The step of generating the final colorimetric DCT coefficients based on the initial colorimetric table and colorimetric correction matrix specifically includes: Based on the initial colorimetric table, generate the updated colorimetric table; Based on the updated colorimetric table and colorimetric correction matrix, the final colorimetric DCT coefficients are generated.

6. The color correction method according to claim 5, characterized in that, The method for generating the updated color metric table specifically includes: Through the formula: Generate an updated color metric table ; In the formula, This represents the initial colorimetric table, where 'a' is the colorimetric enhancement intensity factor. The horizontal frequency weighting coefficient, The vertical frequency weighting coefficient. This represents the horizontal frequency coordinates of the DCT coefficients. This represents the vertical frequency coordinates of the DCT coefficients. This represents the frequency attenuation coefficient. It is a natural exponential function.

7. A color correction method according to claim 6, characterized in that, The specific methods for generating the final colorimetric DCT coefficients include: Through the formula: Generate the final colorimetric DCT coefficients ; In the formula, This is the chromaticity correction matrix. This is the updated color metric table.

8. The color correction method according to claim 1, characterized in that, The step of outputting a compressed image bitstream based on the final colorimetric DCT coefficients and entropy coding table specifically includes: Based on the frequency position of the final chromatic DCT coefficients, the AC coefficients are divided into low-frequency bands and high-frequency bands; where AC coefficients refer to all coefficients in the DCT matrix except for DC coefficients, and DC coefficients are located in the upper left corner of the DCT matrix; For the non-zero AC coefficients in the low-frequency band, variable-length coding is used to generate Run-Level coded pairs of non-zero coefficients in the low-frequency band; For the AC coefficients of the high-frequency band, the stroke length of the continuous zero coefficients is directly calculated to generate the stroke length of the continuous zero coefficients of the high-frequency band. For the DC coefficients of each block, differential pulse code modulation is used to generate the differential DC coefficient value of the current block; A compressed image bitstream is generated based on the Run-Level coding pairs of non-zero coefficients in the low-frequency band, the run length of continuous zero coefficients in the high-frequency band, the DC coefficient difference value of the current block, and the entropy coding table.

9. A color correction method according to claim 8, characterized in that, The specific methods for generating the compressed image bitstream include: Through the formula: Generate compressed image bitstream ; In the formula, This represents the DC coefficient difference value of the current block, which refers to the DCT block being processed among all segmented DCT blocks in the compressed image. This represents the Run-Level coded pairs with non-zero coefficients in the low-frequency band. The sequence number of the current block. This represents the stroke length of the continuous zero coefficients in the high-frequency band, where h is the number of the continuous zero coefficient sequence.

10. A color correction system, characterized in that, The system is used to perform a color correction method according to any one of claims 1-9, specifically including: The data extraction unit is used to extract the colorimetric DCT coefficients, the initial colorimetric table, and the standard color chart calibration matrix of the compressed image; wherein, the colorimetric DCT coefficients include the DCT coefficients of the blue chromaticity component and the DCT coefficients of the red chromaticity component. The colorimetric correction analysis unit is used to generate a colorimetric correction matrix based on the DCT coefficients of the blue colorimetric component and the red colorimetric component of the compressed image and the standard color chart calibration matrix. The chromaticity correction unit is used to correct the frequency domain chromaticity of the compressed image according to the chromaticity correction matrix; The final coefficient generation unit is used to generate the final colorimetric DCT coefficients based on the initial colorimetric table and the colorimetric correction matrix. The image bitstream generation unit is used to quantize the DCT coefficients and entropy coding table based on the final colorimetric data and output a compressed image bitstream.