Scaling down a raster image I have a raster image (A) of size 20x20 and I want to scale it down to a size of 10x10 (B).

Naturally in the resulting picture B one pixel will represent 4 pixels shaped 2x2 from A.

Is it possible to give a canonical answer to how the pixel values of B have to be calculated if no neighbouring pixels (surrounding the 2x2 subset) in A should be taken into account? Mean, maximum or something else?
Bilinear is the most widely used method. The nearest neighbor down-sampling algorithm is the fastest but least accurate. 

Note that when you are trying to down-scale an image by half, the bilinear sampling algorithm becomes the average (mean as you mentioned):

x1[i/2][j/2] = (x[i][j] + x[i+1][j] + x[i][j+1] + x[i+1][j+1]) / 4;