colour.io.write_LUT_SonySPI1D#

colour.io.write_LUT_SonySPI1D(LUT: LUT1D | LUT3x1D | LUTSequence, path: str | PathLike, decimals: int = 7) bool[source]#

Write the specified LUT to the specified Sony .spi1d LUT file.

Parameters:
  • LUT (LUT1D | LUT3x1D | LUTSequence) – LUT1D, LUT3x1D or LUTSequence class instance to write at the specified path.

  • path (str | PathLike) – LUT file path.

  • decimals (int) – Number of decimal places for formatting numeric values.

Returns:

Whether the write operation was successful.

Return type:

bool

Warning

  • If a LUTSequence class instance is passed as LUT, the first LUT in the LUT sequence will be used.

Examples

Writing a 1D Sony .spi1d LUT:

>>> from colour.algebra import spow
>>> domain = np.array([-0.1, 1.5])
>>> LUT = LUT1D(
...     spow(LUT1D.linear_table(16), 1 / 2.2),
...     "My LUT",
...     domain,
...     comments=["A first comment.", "A second comment."],
... )
>>> write_LUT_SonySPI1D(LUT, "My_LUT.spi1d")

Writing a 3x1D Sony .spi1d LUT:

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