Incorrect blending of semi-transparent pixels in raster resampling

Blending a raster with partially opaque pixels fails when using the average or bilinear resampler.