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 1931', 'CIE 1960 UCS', 'CIE 1976 UCS', 'CIE Lab', 'CIE Luv', 'CIE UCS', 'CIE UVW', 'CIE XYZ', 'CIE xyY', 'DIN99', 'HCL', 'HSL', 'HSV', 'Hunter Lab', 'Hunter Rdab', 'ICaCb', 'ICtCp', 'IHLS', 'IPT', 'IPT Ragoo 2021', 'IgPgTg', 'Jzazbz', 'OSA UCS', 'Oklab', 'RGB', 'YCbCr', 'YCoCg', '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 1931', 'CIE 1960 UCS', 'CIE 1976 UCS', 'CIE Lab', 'CIE Luv', 'CIE UCS', 'CIE UVW', 'CIE XYZ', 'CIE xyY', 'DIN99', 'HCL', 'HSL', 'HSV', 'Hunter Lab', 'Hunter Rdab', 'ICaCb', 'ICtCp', 'IHLS', 'IPT', 'IPT Ragoo 2021', 'IgPgTg', 'Jzazbz', 'OSA UCS', 'Oklab', 'RGB', 'YCbCr', 'YCoCg', '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.])