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 2008’, ‘Bianco 2010’, ‘Bianco PC 2010’, 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 (
...     RGB_COLOURSPACE_sRGB, RGB_COLOURSPACE_PROPHOTO_RGB)
>>> RGB = np.array([0.45595571, 0.03039702, 0.04087245])
>>> RGB_to_RGB(RGB, RGB_COLOURSPACE_sRGB, RGB_COLOURSPACE_PROPHOTO_RGB)
... 
array([ 0.2568891...,  0.0721446...,  0.0465553...])