fbpx
Wikipedia

Quantization (image processing)

Quantization, involved in image processing, is a lossy compression technique achieved by compressing a range of values to a single quantum (discrete) 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 image makes it possible to reduce its file size. Specific applications include DCT data quantization in JPEG and DWT data quantization in JPEG 2000.

Color quantization edit

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.

It is common to combine color quantization with dithering to create an impression of a larger number of colors and eliminate banding artifacts.

Frequency quantization for image compression edit

The human eye is fairly good at seeing small differences in brightness over a relatively large area, but not so good at distinguishing the exact strength of a high frequency (rapidly varying) brightness variation. This fact allows one to reduce the amount of information required by ignoring 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.

As human vision is also more sensitive to luminance than chrominance, further compression can be obtained by working in a non-RGB color space which separates the two (e.g., YCbCr), and quantizing the channels separately.[1]

Quantization matrices edit

A typical video codec works by breaking the picture into discrete blocks (8×8 pixels in the case of MPEG[1]). These blocks can then be subjected to discrete cosine transform (DCT) to calculate the frequency components, both horizontally and vertically.[1] The resulting block (the same size as the original block) is then pre-multiplied by the quantization scale code and divided element-wise by the quantization matrix, and rounding each resultant element. The quantization matrix is designed to provide more resolution to more perceivable frequency components over less perceivable components (usually lower frequencies over high frequencies) in addition to transforming as many components to 0, which can be encoded with greatest efficiency. Many video encoders (such as DivX, Xvid, and 3ivx) and compression standards (such as MPEG-2 and H.264/AVC) allow custom matrices to be used. The extent of the reduction may be varied by changing the quantizer scale code, taking up much less bandwidth than a full quantizer matrix.[1]

This is an example of DCT coefficient matrix:

 

A common quantization matrix is:

 

Dividing the DCT coefficient matrix element-wise with this quantization matrix, and rounding to integers results in:

 

For example, using −415 (the DC coefficient) and rounding to the nearest integer

 

Typically this process will result in matrices with values primarily in the upper left (low frequency) corner. By using a zig-zag ordering to group the non-zero entries and run length encoding, the quantized matrix can be much more efficiently stored than the non-quantized version.[1]

See also edit

References edit

  1. ^ a b c d e John Wiseman, An Introduction to MPEG Video Compression,

quantization, image, processing, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sources, unsourced, material, challenged, removed, find, sources, quantization, image, processing, ne. This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Quantization image processing news newspapers books scholar JSTOR November 2012 Learn how and when to remove this template message Quantization involved in image processing is a lossy compression technique achieved by compressing a range of values to a single quantum discrete 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 image makes it possible to reduce its file size Specific applications include DCT data quantization in JPEG and DWT data quantization in JPEG 2000 Contents 1 Color quantization 2 Frequency quantization for image compression 2 1 Quantization matrices 3 See also 4 ReferencesColor quantization editMain article Color quantization 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 It is common to combine color quantization with dithering to create an impression of a larger number of colors and eliminate banding artifacts Frequency quantization for image compression editThe human eye is fairly good at seeing small differences in brightness over a relatively large area but not so good at distinguishing the exact strength of a high frequency rapidly varying brightness variation This fact allows one to reduce the amount of information required by ignoring 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 As human vision is also more sensitive to luminance than chrominance further compression can be obtained by working in a non RGB color space which separates the two e g YCbCr and quantizing the channels separately 1 Quantization matrices edit A typical video codec works by breaking the picture into discrete blocks 8 8 pixels in the case of MPEG 1 These blocks can then be subjected to discrete cosine transform DCT to calculate the frequency components both horizontally and vertically 1 The resulting block the same size as the original block is then pre multiplied by the quantization scale code and divided element wise by the quantization matrix and rounding each resultant element The quantization matrix is designed to provide more resolution to more perceivable frequency components over less perceivable components usually lower frequencies over high frequencies in addition to transforming as many components to 0 which can be encoded with greatest efficiency Many video encoders such as DivX Xvid and 3ivx and compression standards such as MPEG 2 and H 264 AVC allow custom matrices to be used The extent of the reduction may be varied by changing the quantizer scale code taking up much less bandwidth than a full quantizer matrix 1 This is an example of DCT coefficient matrix 415 33 583558 51 15 125 344918271 53 461480 35 50197 18 532134 2023436129 29 5 32 154537 815 167 8114719 28 2 26 27 44 211825 12 443548 37 3 displaystyle begin bmatrix 415 amp 33 amp 58 amp 35 amp 58 amp 51 amp 15 amp 12 5 amp 34 amp 49 amp 18 amp 27 amp 1 amp 5 amp 3 46 amp 14 amp 80 amp 35 amp 50 amp 19 amp 7 amp 18 53 amp 21 amp 34 amp 20 amp 2 amp 34 amp 36 amp 12 9 amp 2 amp 9 amp 5 amp 32 amp 15 amp 45 amp 37 8 amp 15 amp 16 amp 7 amp 8 amp 11 amp 4 amp 7 19 amp 28 amp 2 amp 26 amp 2 amp 7 amp 44 amp 21 18 amp 25 amp 12 amp 44 amp 35 amp 48 amp 37 amp 3 end bmatrix nbsp A common quantization matrix is 1611101624405161121214192658605514131624405769561417222951878062182237566810910377243555648110411392496478871031211201017292959811210010399 displaystyle begin bmatrix 16 amp 11 amp 10 amp 16 amp 24 amp 40 amp 51 amp 61 12 amp 12 amp 14 amp 19 amp 26 amp 58 amp 60 amp 55 14 amp 13 amp 16 amp 24 amp 40 amp 57 amp 69 amp 56 14 amp 17 amp 22 amp 29 amp 51 amp 87 amp 80 amp 62 18 amp 22 amp 37 amp 56 amp 68 amp 109 amp 103 amp 77 24 amp 35 amp 55 amp 64 amp 81 amp 104 amp 113 amp 92 49 amp 64 amp 78 amp 87 amp 103 amp 121 amp 120 amp 101 72 amp 92 amp 95 amp 98 amp 112 amp 100 amp 103 amp 99 end bmatrix nbsp Dividing the DCT coefficient matrix element wise with this quantization matrix and rounding to integers results in 26 3 622 1000 3411000 315 1 1000 412 1000010000000000000000000000000000000 displaystyle begin bmatrix 26 amp 3 amp 6 amp 2 amp 2 amp 1 amp 0 amp 0 0 amp 3 amp 4 amp 1 amp 1 amp 0 amp 0 amp 0 3 amp 1 amp 5 amp 1 amp 1 amp 0 amp 0 amp 0 4 amp 1 amp 2 amp 1 amp 0 amp 0 amp 0 amp 0 1 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 amp 0 end bmatrix nbsp For example using 415 the DC coefficient and rounding to the nearest integer round 41516 round 25 9375 26 displaystyle mathrm round left frac 415 16 right mathrm round left 25 9375 right 26 nbsp Typically this process will result in matrices with values primarily in the upper left low frequency corner By using a zig zag ordering to group the non zero entries and run length encoding the quantized matrix can be much more efficiently stored than the non quantized version 1 See also editImage segmentation Image based meshing Range segmentationReferences edit a b c d e John Wiseman An Introduction to MPEG Video Compression https web archive org web 20111115004238 http www john wiseman com technical MPEG tutorial htm Retrieved from https en wikipedia org w index php title Quantization image processing amp oldid 1133213747, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.