Fix transparency detection.

Was broken in bbcd0def87 and I missed it when checking the pull request.

The bitwise not doesn't work because even though img->color is an
unsigned int, it gets treated as signed in the conditional, so the
resulting number is -256, not 0.

This could be fixed by casting properly (e.g. `(uint8_t)~(img->color &
0xFF)` works), but I see no reason to try to work around the quirks of
bitwise operations when a comparison works just as well and is (in my
opinion) much more straightforward and comprehensible.