You are here: Home > Image pixel re-quantization

Image pixel re-quantization

Short tutorial

When representing the image as a matrix on the computer, we have to select a certain number of possible intensity levels for each pixel. Very often the choice is 256, which is what we get if each pixel is represented by a 8-bit byte. When we represent each pixel using fewer levels, we, on the positive side, can store the image using less storage space (or require less transmission network bandwidth), but at the price of visual degradation and/or less room for maneuver when trying to do any kind of post-processing on the images.

Not only do we have to choose how many possible intensity levels (gray level values) we have, we also have to choose what intensity each of those levels should represent. Most screens have a (more or less) linear scaling of intensity in the interval 0-255, and so, when we choose to use fewer than 256 values for each pixel, we have to decide on a mapping from those (fewer) values to the values the screen should display. One way is to simply do a linear scaling of the pixel-intensities, or we could e.g. try to reduce the overall (re)quantization errors we do.

The amount of false countouring, that is typically found when we use very few intensity levels, can be reduced by adding some noise before doing the re-quantization. This is called dithering. It can be demonstrated in the applet above, as the second image is the same as the first, although with an addition of about 10% gaussian white noise.

Related links:
None yet. Please let us know if you have any suggestions.

Applet instructions

Click the images on the upper right to change the image being processed. The slidebar controls the number of possible intensity values each pixel can have. If the radio button Simple is marked, a simple linear scaling of the quantization levels is performed. If "Optimal" is chosen, we select a mapping where the reduced number of intensity representations in the image matrix is mapped so as to optimally represent the original 8-bit image in a squared-error sense.


comments powered by Disqus © 2008-2024