colour.RGB_to_RGB

colour.RGB_to_RGB(RGB, input_colourspace, output_colourspace, chromatic_adaptation_transform='CAT02', apply_cctf_decoding=False, apply_cctf_encoding=False, **kwargs)[source]

Converts given RGB colourspace array from given input RGB colourspace to output RGB colourspace using given chromatic adaptation method.

Parameters:
  • RGB (array_like) – RGB colourspace array.
  • input_colourspace (RGB_Colourspace) – RGB input colourspace.
  • output_colourspace (RGB_Colourspace) – RGB output colourspace.
  • chromatic_adaptation_transform (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02_BRILL_CAT’, ‘Bianco’, ‘Bianco PC’, None}, Chromatic adaptation transform, if None no chromatic adaptation is performed.
  • apply_cctf_decoding (bool, optional) – Apply input colourspace decoding colour component transfer function / electro-optical transfer function.
  • apply_cctf_encoding (bool, optional) – Apply output colourspace encoding colour component transfer function / opto-electronic transfer function.
Other Parameters:
 

**kwargs (dict, optional) – Keywords arguments for the colour component transfer functions.

Returns:

RGB colourspace array.

Return type:

ndarray

Notes

Domain Scale - Reference Scale - 1
RGB [0, 1] [0, 1]
Range Scale - Reference Scale - 1
RGB [0, 1] [0, 1]

Examples

>>> from colour.models import sRGB_COLOURSPACE, PROPHOTO_RGB_COLOURSPACE
>>> RGB = np.array([0.45595571, 0.03039702, 0.04087245])
>>> RGB_to_RGB(RGB, sRGB_COLOURSPACE, PROPHOTO_RGB_COLOURSPACE)
... # doctest: +ELLIPSIS
array([ 0.2568891...,  0.0721446...,  0.0465553...])