colour.write_LUT

colour.write_LUT(LUT, path, decimals=7, method=None, **kwargs)[source]

Writes given LUT to given file using given method.

Parameters:
  • LUT (LUT1D or LUT3x1D or LUT3D) – LUT1D, LUT3x1D or LUT3D class instance to write at given path.
  • path (unicode) – LUT path.
  • decimals (int, optional) – Formatting decimals.
  • method (unicode, optional) – {None, ‘Cinespace’, ‘Iridas Cube’, ‘Resolve Cube’, ‘Sony SPI1D’, ‘Sony SPI3D’}, Writing method, if None, the method will be auto-detected according to extension.
Returns:

Definition success.

Return type:

bool

References

[AdobeSystems2013b], [Chamberlain2015], [RisingSunResearch]

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')  # doctest: +SKIP

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')  # doctest: +SKIP

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')  # doctest: +SKIP