colour.plotting.models.colourspace_model_axis_reorder#

colour.plotting.models.colourspace_model_axis_reorder(a: ArrayLike, model: Union[Literal['CAM02LCD', 'CAM02SCD', 'CAM02UCS', 'CAM16LCD', 'CAM16SCD', 'CAM16UCS', 'CIE XYZ', 'CIE xyY', 'CIE Lab', 'CIE LCHab', 'CIE Luv', 'CIE LCHuv', 'CIE UCS', 'CIE UVW', 'DIN99', 'Hunter Lab', 'Hunter Rdab', 'ICaCb', 'ICtCp', 'IPT', 'IPT Munish 2021', 'IgPgTg', 'Jzazbz', 'OSA UCS', 'Oklab', 'hdr-CIELAB', 'hdr-IPT'], str], direction: Union[Literal['Forward', 'Inverse'], str] = 'Forward') ndarray[source]#

Reorder the axes of given colourspace model \(a\) array according to the most common volume plotting axes order.

Parameters:
  • a (ArrayLike) – Colourspace model \(a\) array.

  • model (Union[Literal['CAM02LCD', 'CAM02SCD', 'CAM02UCS', 'CAM16LCD', 'CAM16SCD', 'CAM16UCS', 'CIE XYZ', 'CIE xyY', 'CIE Lab', 'CIE LCHab', 'CIE Luv', 'CIE LCHuv', 'CIE UCS', 'CIE UVW', 'DIN99', 'Hunter Lab', 'Hunter Rdab', 'ICaCb', 'ICtCp', 'IPT', 'IPT Munish 2021', 'IgPgTg', 'Jzazbz', 'OSA UCS', 'Oklab', 'hdr-CIELAB', 'hdr-IPT'], str]) – Colourspace model, see colour.COLOURSPACE_MODELS attribute for the list of supported colourspace models.

  • direction (Union[Literal['Forward', 'Inverse'], str]) – Reordering direction.

Returns:

Reordered colourspace model \(a\) array.

Return type:

numpy.ndarray

Examples

>>> a = np.array([0, 1, 2])
>>> colourspace_model_axis_reorder(a, 'CIE Lab')
array([ 1.,  2.,  0.])
>>> colourspace_model_axis_reorder(a, 'IPT')
array([ 1.,  2.,  0.])
>>> colourspace_model_axis_reorder(a, 'OSA UCS')
array([ 1.,  2.,  0.])
>>> b = np.array([1, 2, 0])
>>> colourspace_model_axis_reorder(b, 'OSA UCS', 'Inverse')
array([ 0.,  1.,  2.])