colour.RGB_to_RGB

colour.RGB_to_RGB(RGB: ArrayLike, input_colourspace: colour.models.rgb.rgb_colourspace.RGB_Colourspace, output_colourspace: colour.models.rgb.rgb_colourspace.RGB_Colourspace, chromatic_adaptation_transform: Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str] = 'CAT02', apply_cctf_decoding: bool = False, apply_cctf_encoding: bool = False, **kwargs: Any) numpy.ndarray[source]

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

Parameters
  • RGB (ArrayLike) – RGB colourspace array.

  • input_colourspace (colour.models.rgb.rgb_colourspace.RGB_Colourspace) – RGB input colourspace.

  • output_colourspace (colour.models.rgb.rgb_colourspace.RGB_Colourspace) – RGB output colourspace.

  • chromatic_adaptation_transform (Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str]) – Chromatic adaptation transform, if None no chromatic adaptation is performed.

  • apply_cctf_decoding (bool) – Apply input colourspace decoding colour component transfer function / electro-optical transfer function.

  • apply_cctf_encoding (bool) – Apply output colourspace encoding colour component transfer function / opto-electronic transfer function.

  • kwargs (Any) – Keywords arguments for the colour component transfer functions.

Returns

RGB colourspace array.

Return type

numpy.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...])