def xyz2rgb(xyz):
 arr = _convert(rgb_from_xyz, xyz)
 mask = (arr > 0.0031308)
 arr[mask] = ((1.055 * np.power(arr[mask], (1 / 2.4))) - 0.055)
 arr[(~ mask)] *= 12.92
 arr[(arr < 0)] = 0
 arr[(arr > 1)] = 1
 return arr

def xyz2rgb ( xyz ) : arr = _convert ( rgb_from_xyz , xyz ) mask = ( arr > 0.0031308 ) arr [ mask ] = ( ( 1.055 * np . power ( arr [ mask ] , ( 1 / 2.4 ) ) ) - 0.055 ) arr [ ( ~ mask ) ] *= 12.92 arr [ ( arr < 0 ) ] = 0 arr [ ( arr > 1 ) ] = 1 return arr
xyz to rgb color space conversion .