colour.plotting.models.colourspace_model_axis_reorder#

colour.plotting.models.colourspace_model_axis_reorder(a: ArrayLike, model: Literal['CAM02LCD', 'CAM02SCD', 'CAM02UCS', 'CAM16LCD', 'CAM16SCD', 'CAM16UCS', 'CIE Lab', 'CIE Luv', 'CIE UCS', 'CIE UVW', 'CIE XYZ', 'CIE xyY', 'DIN99', 'Hunter Lab', 'Hunter Rdab', 'ICaCb', 'ICtCp', 'IPT', 'IPT Ragoo 2021', 'IgPgTg', 'Jzazbz', 'OSA UCS', 'Oklab', 'Yrg', 'hdr-CIELAB', 'hdr-IPT'] | str, direction: Literal['Forward', 'Inverse'] | str = 'Forward') NDArrayFloat[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 (Literal['CAM02LCD', 'CAM02SCD', 'CAM02UCS', 'CAM16LCD', 'CAM16SCD', 'CAM16UCS', 'CIE Lab', 'CIE Luv', 'CIE UCS', 'CIE UVW', 'CIE XYZ', 'CIE xyY', 'DIN99', 'Hunter Lab', 'Hunter Rdab', 'ICaCb', 'ICtCp', 'IPT', 'IPT Ragoo 2021', 'IgPgTg', 'Jzazbz', 'OSA UCS', 'Oklab', 'Yrg', 'hdr-CIELAB', 'hdr-IPT'] | str) – Colourspace model, see colour.COLOURSPACE_MODELS attribute for the list of supported colourspace models.

  • direction (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.])