Demo of quantization levels

CS 248 - Introduction to Computer Graphics
Autumn Quarter, 2008
Marc Levoy

The first test image (top row) is synthetic, so it should require the most number of bits to look good. To my eye, the solid glass cone lying on its side (upper-right corner) begins to exhibit quantization artifacts, i.e. contouring, at 5 bits.

The second test image is an optically scanned photograph taken by a film camera. The optical scanner had a gamma of 1.0, thereby producing a file whose pixel values are proportional to luminance. The third row of the table shows quantization of this image. To my eye, it begins to show quantization artifacts at 5 bits, but less severely so than the synthetic image, probably because of film or digitization noise. Look in particular at the top surface of the leading edge of the raft. In the second row of the table, the same image has been raised to the power 0.5, making pixel values proportional to perceived brightness. The image in the left column shows the result of this gamma transform. The transformed image is then quantized in that space, and resulting quantized images are raised to the power 2.0 to restore the original color levels, so that they can be compared on the same display at the same time to the third and fourth rows. These quantized and restored images are shown in the rightmost three columns. To my eye, this version exhibits fewer artifacts than the third row. For further comparison, in the fourth row the same image has been raised to the power 2.0 - exactly the wrong gamma transform for human viewers, quantized in that space, then raised to the power 0.5 to restore the original color levels. This version clearly exhibits more artifacts than the second or third rows.

The third image is an optically scanned hand-painted cartoon background. To my eye, it looks fine at 5 bits, but begins to show artifacts at 4 bits. This reduction in the number of bits is at least partially due to the more random nature of the hand painting.

Finally, the fourth image is an optically scanned pencil drawing. It does fine down to 3 bits, due mainly to the narrow spatial extent of the "zone of antialiasing", i.e. of midrange gray pixels, over which the quantization occurs. This same property allows text to be antialiased using few bits.

Note: This demo must be viewed on a gamma-corrected display, i.e. system B in the class notes. On the teaching lab PCs, you can enable gamma correction by typing "xgamma 1.7". If you don't do this, the quantization effects will be hard to compare, and the subtle differences between applying quantization in different spaces will be almost invisible. For more information about gamma correction and viewing web pages, look at our research lab's tutorial about gamma correction.

original quantization space quantized versions
(converted back to linear luminance after quantization if necessary)

linear luminance
6 bits

5 bits

4 bits

linear perceived brightness
(original1/2)

6 bits

5 bits

4 bits

linear luminance
(original image)

6 bits

5 bits

4 bits

original2
6 bits

5 bits

4 bits

linear luminance
6 bits

5 bits

4 bits

linear luminance
4 bits

3 bits

2 bits


levoy@cs.stanford.edu
Copyright © 2008 Marc Levoy
Last update: September 24, 2008 03:20:19 PM