colour.write_LUT

colour.write_LUT(LUT: Union[colour.io.luts.lut.LUT1D, colour.io.luts.lut.LUT3x1D, colour.io.luts.lut.LUT3D, colour.io.luts.sequence.LUTSequence, colour.io.luts.operator.LUTOperatorMatrix], path: str, decimals: int = 7, method: Optional[Union[Literal['Cinespace', 'Iridas Cube', 'Resolve Cube', 'Sony SPI1D', 'Sony SPI3D', 'Sony SPImtx'], str]] = None, **kwargs: Any) bool[source]

Write given LUT to given file using given method.

Parameters
Returns

Definition success.

Return type

bool

References

[AdobeSystems13c], [Cha15], [RisingSResearch]

Examples

Writing a 3x1D Iridas .cube LUT:

>>> import numpy as np
>>> from colour.algebra import spow
>>> domain = np.array([[-0.1, -0.2, -0.4], [1.5, 3.0, 6.0]])
>>> LUT = LUT3x1D(
...     spow(LUT3x1D.linear_table(16, domain), 1 / 2.2),
...     'My LUT',
...     domain,
...     comments=['A first comment.', 'A second comment.'])
>>> write_LUT(LUT, 'My_LUT.cube')  

Writing a 1D Sony .spi1d LUT:

>>> domain = np.array([-0.1, 1.5])
>>> LUT = LUT1D(
...     spow(LUT1D.linear_table(16, domain), 1 / 2.2),
...     'My LUT',
...     domain,
...     comments=['A first comment.', 'A second comment.'])
>>> write_LUT(LUT, 'My_LUT.spi1d')  

Writing a 3D Sony .spi3d LUT:

>>> LUT = LUT3D(
...     LUT3D.linear_table(16) ** (1 / 2.2),
...     'My LUT',
...     np.array([[0, 0, 0], [1, 1, 1]]),
...     comments=['A first comment.', 'A second comment.'])
>>> write_LUT(LUT, 'My_LUT.cube')