def rgb2xyz(rgb):
 arr = _prepare_colorarray(rgb).copy()
 mask = (arr > 0.04045)
 arr[mask] = np.power(((arr[mask] + 0.055) / 1.055), 2.4)
 arr[(~ mask)] /= 12.92
 return _convert(xyz_from_rgb, arr)

def rgb2xyz ( rgb ) : arr = _prepare_colorarray ( rgb ) . copy ( ) mask = ( arr > 0.04045 ) arr [ mask ] = np . power ( ( ( arr [ mask ] + 0.055 ) / 1.055 ) , 2.4 ) arr [ ( ~ mask ) ] /= 12.92 return _convert ( xyz_from_rgb , arr )
rgb to xyz color space conversion .