Every output pixel, itemised
The weight microscope
Move the cursor over the magnified image. For whichever output pixel you land on, this shows the exact source pixels consulted, the exact weight given to each, and the arithmetic that produced the colour. Nearest uses 1 sample, bilinear 4, bicubic 16 — here is what that actually looks like.
Each square is one source pixel. The highlighted ones are the only pixels that contribute to the output pixel under your cursor — everything else in the image is irrelevant to it.
The crosshair marks the output pixel being itemised on the right. Its position between source samples — the fractional offset — is what selects the weights.
Each cell shows the weight and, below it, the source pixel's grey value. Weights come from the outer product of the horizontal and vertical kernels: wij = W(i − u) · W(j − v). Red cells are negative — bicubic subtracts those samples, which is why it can sharpen and why it can ring.
The weights always sum to one. Check the readout as you move around: whatever the fractional position, the sixteen bicubic weights total exactly 1.000. They have to. If they summed to 1.02 the image would get 2% brighter every time it was resampled, and if they summed to 0.98 it would fade. This property has a name — partition of unity — and any interpolation kernel worth using has it.
Land exactly on a source pixel and the microscope goes quiet. At a whole-number position the cubic kernel evaluates to 1 at the centre and exactly 0 at every other tap, so bicubic returns that pixel untouched. All three methods agree there. It is only between samples that they differ — which is the whole of the difference between them.
Watch the negative total as you cross an edge. In a flat region the negative taps subtract from neighbours that look much the same, so they cancel and change little. At an edge, the outer taps sit on the far side of the transition and the subtraction bites: the result is pushed away from the average, past the range of the samples themselves. That is where a bright halo appears next to a dark stroke. Set a to 0 and the negative total goes to zero — along with the halo, and with the sharpness.