colour.io.LUT_to_LUT

colour.io.LUT_to_LUT(LUT, cls, force_conversion=False, **kwargs)[source]

Converts given LUT to given cls class instance.

Parameters:
  • cls (LUT1D or LUT3x1D or LUT3D) – LUT class instance.
  • force_conversion (bool, optional) – Whether to force the conversion as it might be destructive.
Other Parameters:
 
  • interpolator (object, optional) – Interpolator class type to use as interpolating function.
  • interpolator_args (dict_like, optional) – Arguments to use when instantiating the interpolating function.
  • size (int, optional) – Expected table size in case of an upcast to or a downcast from a LUT3D class instance.
  • channel_weights (array_like, optional) – Channel weights in case of a downcast from a LUT3x1D or LUT3D class instance.
Returns:

Converted LUT class instance.

Return type:

LUT1D or LUT3x1D or LUT3D

Warning

Some conversions are destructive and raise a ValueError exception by default.

Raises:ValueError – If the conversion is destructive.

Examples

>>> print(LUT_to_LUT(LUT1D(), LUT3D, force_conversion=True))
LUT3D - Unity 10 - Converted 1D to 3D
-------------------------------------
<BLANKLINE>
Dimensions : 3
Domain     : [[ 0.  0.  0.]
              [ 1.  1.  1.]]
Size       : (33, 33, 33, 3)
>>> print(LUT_to_LUT(LUT3x1D(), LUT1D, force_conversion=True))
LUT1D - Unity 10 - Converted 3x1D to 1D
---------------------------------------
<BLANKLINE>
Dimensions : 1
Domain     : [ 0.  1.]
Size       : (10,)
>>> print(LUT_to_LUT(LUT3D(), LUT1D, force_conversion=True))
LUT1D - Unity 33 - Converted 3D to 1D
-------------------------------------
<BLANKLINE>
Dimensions : 1
Domain     : [ 0.  1.]
Size       : (10,)