colour.write_LUT#
- colour.write_LUT(LUT: LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix, path: str | Path, decimals: int = 7, method: Literal['Cinespace', 'Iridas Cube', 'Resolve Cube', 'Sony SPI1D', 'Sony SPI3D', 'Sony SPImtx'] | str | None = None, **kwargs: Any) bool [source]#
Write given LUT to given file using given method.
- Parameters:
LUT (LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix) –
colour.LUT1D
orcolour.LUT3x1D
orcolour.LUT3D
orcolour.LUTSequence
orcolour.LUTOperatorMatrix
class instance to write at given path.decimals (int) – Formatting decimals.
method (Literal['Cinespace', 'Iridas Cube', 'Resolve Cube', 'Sony SPI1D', 'Sony SPI3D', 'Sony SPImtx'] | str | None) – Writing method, if None, the method will be auto-detected according to extension.
kwargs (Any)
- Returns:
Definition success.
- Return type:
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")