colour.matrix_RGB_to_RGB#

colour.matrix_RGB_to_RGB(input_colourspace: RGB_Colourspace, output_colourspace: RGB_Colourspace, chromatic_adaptation_transform: Optional[Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str]] = 'CAT02') ndarray[source]#

Compute the matrix \(M\) converting from given input RGB colourspace to output RGB colourspace using given chromatic adaptation method.

Parameters:
  • input_colourspace (RGB_Colourspace) – RGB input colourspace.

  • output_colourspace (RGB_Colourspace) – RGB output colourspace.

  • chromatic_adaptation_transform (Optional[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.

Returns:

Conversion matrix \(M\).

Return type:

numpy.ndarray

Examples

>>> from colour.models import (
...    RGB_COLOURSPACE_sRGB, RGB_COLOURSPACE_PROPHOTO_RGB)
>>> matrix_RGB_to_RGB(RGB_COLOURSPACE_sRGB, RGB_COLOURSPACE_PROPHOTO_RGB)
... 
array([[ 0.5288241...,  0.3340609...,  0.1373616...],
       [ 0.0975294...,  0.8790074...,  0.0233981...],
       [ 0.0163599...,  0.1066124...,  0.8772485...]])