Fix pixels always considered transparent on 8-bit surfaces (fix #329).