0

我可以使用 Color 和 Numpy 将 RGB 值转换为 Lab:

rgb = np.array([100, 80, 20]) / 255
xyz = colour.sRGB_to_XYZ(rgb)
lab = colour.XYZ_to_Lab(xyz)
print(lab) # 35, 4, 36

但是当我想使用特定的白点时,D50 就像这个例子

rgb = np.array([100, 80, 20]) / 255
D50 = colour.CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']
xyz = colour.sRGB_to_XYZ(rgb, illuminant=D50)
print(colour.XYZ_to_Lab(xyz, illuminant=D50))

我得到错误

D50 = colour.CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']


File "D:\Python30\lib\site-packages\colour\__init__.py", line 325, in __getattr__
    return super(colour, self).__getattr__(attribute)
  File "D:\Python30\lib\site-packages\colour\utilities\deprecation.py", line 351, in __getattr__
    return getattr(self._module, attribute)
AttributeError: module 'colour' has no attribute 'CCS_ILLUMINANTS'

我究竟做错了什么?

4

0 回答 0