colour.write_LUT#
- colour.write_LUT(LUT: LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix, path: str | PathLike, decimals: int = 7, method: LiteralLUTWriteMethod | str | None = None, **kwargs: Any) bool[source]#
Write the specified LUT to the specified file.
- Parameters:
LUT (LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix) –
colour.LUT1Dorcolour.LUT3x1Dorcolour.LUT3Dorcolour.LUTSequenceorcolour.LUTOperatorMatrixclass instance to write at the specified path.decimals (int) – Number of decimal places for formatting numeric values.
method (LiteralLUTWriteMethod | str | None) – Writing method, if None, the method will be auto-detected according to the file extension.
kwargs (Any)
- Returns:
Definition success.
- Return type:
References
[AdobeSystems13], [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")