Quiz: quantisation and bit depth
Before this unit: Day 1: Images, filters and frequencies.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. A camera has a 12-bit ADC and a monitor shows 8 bits per channel. How many camera levels fall on one monitor level if the whole camera range is shown?
2^{12} / 2^8 = 4096 / 256 = 16 camera levels per monitor level. The monitor cannot show the difference between them, but the data still contain it: measure on the 12-bit numbers, not on the screenshot.
Q2. You reduce an image from 8 to 7 bits. By what factor does the RMS quantisation error grow, and what happens to the SNR in dB?
How does the step \Delta change when you remove one bit?
The step doubles (from 1/255 to 1/127 of the range, almost exactly a factor 2), so the RMS error \Delta/\sqrt{12} doubles too. The SNR drops by 20\log_{10}2 \approx 6 dB.
Q3. Why is banding easy to see in a picture of a clear blue sky, and hard to see in a picture of grass, even with the same bit depth?
In the sky, brightness changes slowly over many pixels, so many neighbouring pixels round the same way and the steps line up into visible contour lines. In the grass, the brightness changes a lot from pixel to pixel; the rounding error is different for each pixel and looks like (invisible) noise. The texture acts as a natural dither.
Q4. Adding random noise before rounding (dithering) makes the RMS error larger. Why do we do it anyway?
Without dither, the error follows the image: it forms bands that look like edges that are not there, and a value between two levels is always pushed the same way (a bias). With dither, the error is independent of the image and has mean zero for every grey value, so averaging over a region (or by the eye) recovers grey values between the levels. Structured error is worse than a slightly larger random error.