- Quantization (image processing)
Quantization, involved in
image processing, is a lossy compressiontechnique achieved by compressing a range of values to a single quantum value. When the number of discrete symbols in a given stream is reduced, the stream becomes more compressible. For example, reducing the number of colors required to represent a digital imagemakes it possible to reduce its file size. Specific applications include DCT data quantization in JPEGand DWT data quantization in JPEG 2000. __FORCETOC__
Color quantization reduces the number of colors used in an image; this is important for displaying images on devices that support a limited number of colors and for efficiently compressing certain kinds of images. Most bitmap editors and many operating systems have built-in support for color quantization. Popular modern color quantization algorithms include the nearest color algorithm (for fixed palettes), the
median cut algorithm, and an algorithm based on octrees.
Frequency quantization for image compression
The human eye is fairly good at seeing small differences in
brightnessover a relatively large area, but not so good at distinguishing the exact strength of a high frequency brightness variation. This fact allows one to get away with a greatly reduced amount of information in the high frequency components. This is done by simply dividing each component in the frequency domain by a constant for that component, and then rounding to the nearest integer. This is the main lossy operation in the whole process. As a result of this, it is typically the case that many of the higher frequency components are rounded to zero, and many of the rest become small positive or negative numbers.
A quantization matrix is used in combination with a DCT coefficient matrix to carry out the previously mentioned transformation. Quantization matrices are often specifically designed to keep certain frequencies in the source to avoid losing image quality. Many video encoders, such as
Xvid, 3ivxand H.264/AVCallow custom matrices to be used.
This is an example DCT coefficient matrix:
A common quantization matrix is:
Using this quantization matrix with the DCT coefficient matrix from above results in:
For example, using −415 (the DC coefficient) and rounding to the nearest integer
Wikimedia Foundation. 2010.