colour.RGB_to_RGB#

colour.RGB_to_RGB(RGB: Domain1, input_colourspace: RGB_Colourspace | LiteralRGBColourspace | str, output_colourspace: RGB_Colourspace | LiteralRGBColourspace | str, chromatic_adaptation_transform: LiteralChromaticAdaptationTransform | str | None = 'CAT02', apply_cctf_decoding: bool = False, apply_cctf_encoding: bool = False, **kwargs: Any) Range1[source]#

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

Parameters:
  • RGB (Domain1) – RGB colourspace array.

  • input_colourspace (RGB_Colourspace | LiteralRGBColourspace | str) – RGB input colourspace.

  • output_colourspace (RGB_Colourspace | LiteralRGBColourspace | str) – RGB output colourspace.

  • chromatic_adaptation_transform (LiteralChromaticAdaptationTransform | str | None) – Chromatic adaptation transform, if None no chromatic adaptation is performed.

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

  • apply_cctf_encoding (bool) – Apply the 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

1

1

Range

Scale - Reference

Scale - 1

RGB

1

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...])
>>> RGB_to_RGB(RGB, "sRGB", "ProPhoto RGB")
...
array([ 0.2568891...,  0.0721446...,  0.0465553...])