从float64到uint8的有损转换

float64(x)范围[0,1]到uint8(y)范围[0,255]的转换

y =  (x*255).astype(np.uint8))
原文地址:https://www.cnblogs.com/tingtin/p/14629504.html