def norm0255(arr):
 arr = arr.copy()
 arr -= arr.min()
 arr *= (255.0 / (arr.max() + 1e-10))
 arr = np.array(arr, 'uint8')
 return arr

def norm0255 ( arr ) : arr = arr . copy ( ) arr -= arr . min ( ) arr *= ( 255.0 / ( arr . max ( ) + 1e-10 ) ) arr = np . array ( arr , 'uint8' ) return arr
maps the input range to [0 .