efficient conversion of uint8