colour.io.LUT_to_LUT#
- colour.io.LUT_to_LUT(LUT: AbstractLUT, cls: Type[AbstractLUT], force_conversion: bool = False, **kwargs: Any) AbstractLUT [source]#
Convert given LUT to given
cls
class instance.- Parameters:
LUT (AbstractLUT) – LUT to convert.
cls (Type[AbstractLUT]) – LUT class instance.
force_conversion (bool) – Whether to force the conversion if destructive.
channel_weights – Channel weights in case of a downcast from a
LUT3x1D
orLUT3D
class instance.interpolator – Interpolator class type to use as interpolating function.
interpolator_kwargs – Arguments to use when instantiating the interpolating function.
size – Expected table size in case of an upcast to or a downcast from a
LUT3D
class instance.kwargs (Any)
- Returns:
Converted LUT class instance.
- Return type:
Warning
Some conversions are destructive and raise a
ValueError
exception by default.- Raises:
ValueError – If the conversion is destructive.
- Parameters:
- Return type:
AbstractLUT
Examples
>>> print(LUT_to_LUT(LUT1D(), LUT3D, force_conversion=True)) LUT3D - Unity 10 - Converted 1D to 3D ------------------------------------- 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 --------------------------------------- Dimensions : 1 Domain : [ 0. 1.] Size : (10,) >>> print(LUT_to_LUT(LUT3D(), LUT1D, force_conversion=True)) LUT1D - Unity 33 - Converted 3D to 1D ------------------------------------- Dimensions : 1 Domain : [ 0. 1.] Size : (10,)