Images as sampled signals
The light arriving at the sensor is a continuous function of the position on the image plane, with one value for gray images or three for color. A digital image stores this function only on a regular grid, and only with a finite set of values:
Here is the distance between samples and is the quantizer. The image is then a matrix of integers: row , column , with the origin in the top-left corner.
Sampling
The spatial resolution is the number of samples. Using a cell size keeps one value per cell of the original, so the image shrinks to pixels. Enlarged back to the original size, every sample becomes a visible block.
The value of a sample can be taken at the cell center (an ideal point sample), or averaged over the cell. The average is closer to a real sensor pixel, which collects all light falling onto its area. Detail finer than the grid cannot be represented either way: point samples turn it into false coarse patterns (aliasing, clearly visible in the zone plate), while averaging blurs it away first.
Quantization
With bits per value there are levels. For values :
In smooth gradients, neighboring pixels round to the same level for a while and then jump to the next one. This creates visible steps called banding or false contours. With 8 bits (256 levels) the steps are usually too small to see, which is why 8 bits per channel is the standard for images. Camera sensors often record 10 to 14 bits, which leaves room for later processing such as brightening dark areas.
Try this
- Set the bits to 1. Every channel is either 0 or 1, so a color image has only colors.
- Pick the gradients image and increase the bits one at a time. From which bit depth on do the bands in the dark ramp disappear for you?
- Click on the sky of the landscape at 4 bits and look at the row plot: the thick staircase only takes values on the grid lines.
- Switch on grayscale and compare with color at the same bit depth. Color images with 3 bits per channel still have 512 colors, gray images only 8 levels.
- Choose the zone plate with cell size 4 and “cell center”. Rings appear where there are none; switch to “cell average” and most of them fade to gray.
- Look at the fence of the landscape with a large cell size. The pickets merge, split or disappear depending on where the grid happens to hit them.
- Compare two settings with the same storage: 2 × 2 cells at 8 bits and 1 × 1 cells at 2 bits. Which loss is more visible?