Skip to content
KinPilot™Learn & Explore
Menu

Grades 6–8 · Computing

What is lost when a grayscale image uses fewer brightness levels?

A grayscale image can represent brightness with integer samples. This toy uses values zero through fifteen, with zero darkest and fifteen lightest. Four bits can distinguish all sixteen possibilities. The four original samples are three, six, ten and fourteen.

D23 visual explanationFour grayscale inputs 3,6,10,14 are quantized by floor(value/4) and reconstructed by multiplying the index by 4. Reconstructed values are 0,4,8,12; errors are 3,2,2,2. The index payload uses 8 bits rather than 16, excluding overhead. The operation loses distinctions and is not a full JPEG codec.Quantization can discard image distinctionsToy grayscale 0–15 · step 4 · round downOriginal361014Reconstructed04812Index payload 8 bits vs 16 raw; overhead excluded.

In the diagramQuantization can discard image distinctionsToy grayscale 0–15 · step 4 · round downOriginal361014Reconstructed04812Index payload 8 bits vs 16 raw; overhead excluded.

Step-four quantization reconstructs 3,6,10,14 as 0,4,8,12 and loses the original distinctions.

Quantization replaces fine distinctions with a smaller set of levels. With step four, dividing each value by four and rounding down gives indices zero, one, two and three. Multiplying those indices by four reconstructs zero, four, eight and twelve. The reconstruction is deliberately coarser than the original.

The differences between originals and reconstructions are three, two, two and two level units. Information has been lost: several possible original values lead to each index, so the index does not reveal which one occurred. This many-to-one step is lossy. A lossless representation would allow the exact original sample sequence to be recovered. In a picture, two nearby shades can therefore become the same shade. Fine brightness changes that helped describe a shadow or rounded surface may disappear even though the larger shapes remain recognizable.

Four possible indices need two bits each, giving eight sample-payload bits rather than the original sixteen. Format overhead is excluded, so this is not a complete file-size prediction. Larger steps keep fewer levels and discard more distinctions. Real image compression can combine lossy quantization with other encoding stages; this small integer rule explains the loss without claiming to implement JPEG.

About this explanation

Starting knowledge: Read small grayscale integers, divide with rounding down and recognize powers-of-two bit capacities.

Sources

  • University of Canterbury, Computer Science Field Guide — Lossy versus lossless compression
  • The Open University — Quantisation and reconstruction error
← Grades 6–8 topics