Scaling artefacts

1. Original test pattern of black and white stripes, 720 pixels wide:

2. The same pattern rescaled to 792 horizontal pixels. Resampling artefacts are very noticeable at the top and bottom:

3. The above image after being scaled back again to 720 pixels. Notice how the artefacts in the pattern are less prominent here. What remains is mostly a smoothing effect due to the leakage of information from neighbouring pixels:


I have no exact theory about why this works the way it does, but here is my handwaving-type explanation:

The image we see is from a mathematical point of view an interpolated signal constructed from a discrete set of sample points. Scaling up the pixels corresponds to resampling this signal at a higher frequency, 10% higher in the example above. The wave patterns seen are modulation artefacts produced by interference with the new higher frequencies: the sum of two pure harmonic waves is equivalent to one high-frequency wave that is modulated by a low-frequency wave, which the human brain perceives as an illusory extra low-frequency component that seems to be present despite the fact that this frequency has a zero value in the signal's Fourier transform. But why are these new higher frequencies non-zero? Only because our imperfect interpolation methods introduce them. Normally, linear or cubic interpolation is used, and they don't reproduce a truly frequency-limited signal. Only convolution of the discrete samples with the function sin(x)/x does that, and that is a rather expensive operation.

When the pixels are scaled down again these added higher frequencies are removed again, but only if we scale back to exactly the original frequency, or the original pixel count in this case. So the artefacts disappear, but some blurring remains due to the averaging (anti-aliasing) of neighbouring pixels during re-interpolation.