For some reason, I had forgotten this, and it showed up because Qt
has buggy handling of pixels with alpha != 0xff. Add unit test
so it doesn't happen again.
I'm a bit concerned that rounding might cause problems so that we
should perhaps renormalize after the bilinear conversion, but we
can deal with that later if it should show up.