colour.read_LUT

colour.read_LUT(path: str, method: Optional[Union[Literal['Cinespace', 'Iridas Cube', 'Resolve Cube', 'Sony SPI1D', 'Sony SPI3D', 'Sony SPImtx'], str]] = None, **kwargs: Any) 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][source]

Read given LUT file using given method.

Parameters
  • path (str) – LUT path.

  • method (Optional[Union[Literal['Cinespace', 'Iridas Cube', 'Resolve Cube', 'Sony SPI1D', 'Sony SPI3D', 'Sony SPImtx'], str]]) – Reading method, if None, the method will be auto-detected according to extension.

  • kwargs (Any) –

Returns

colour.LUT1D or colour.LUT3x1D or colour.LUT3D or colour.LUTSequence or colour.LUTOperatorMatrix class instance.

Return type

colour.LUT1D or colour.LUT3x1D or colour.LUT3D or colour.LUTSequence or colour.LUTOperatorMatrix

References

[AdobeSystems13c], [Cha15], [RisingSResearch]

Examples

Reading a 3x1D Iridas .cube LUT:

>>> path = os.path.join(
...     os.path.dirname(__file__), 'tests', 'resources', 'iridas_cube',
...     'ACES_Proxy_10_to_ACES.cube')
>>> print(read_LUT(path))
LUT3x1D - ACES Proxy 10 to ACES
-------------------------------

Dimensions : 2
Domain     : [[ 0.  0.  0.]
              [ 1.  1.  1.]]
Size       : (32, 3)

Reading a 1D Sony .spi1d LUT:

>>> path = os.path.join(
...     os.path.dirname(__file__), 'tests', 'resources', 'sony_spi1d',
...     'eotf_sRGB_1D.spi1d')
>>> print(read_LUT(path))
LUT1D - eotf sRGB 1D
--------------------

Dimensions : 1
Domain     : [-0.1  1.5]
Size       : (16,)
Comment 01 : Generated by "Colour 0.3.11".
Comment 02 : "colour.models.eotf_sRGB".

Reading a 3D Sony .spi3d LUT:

>>> path = os.path.join(
...     os.path.dirname(__file__), 'tests', 'resources', 'sony_spi3d',
...     'Colour_Correct.spi3d')
>>> print(read_LUT(path))
LUT3D - Colour Correct
----------------------

Dimensions : 3
Domain     : [[ 0.  0.  0.]
              [ 1.  1.  1.]]
Size       : (4, 4, 4, 3)
Comment 01 : Adapted from a LUT generated by Foundry::LUT.

Reading a Sony .spimtx LUT:

>>> path = os.path.join(
...     os.path.dirname(__file__), 'tests', 'resources', 'sony_spimtx',
...     'dt.spimtx')
>>> print(read_LUT(path))
LUTOperatorMatrix - dt
----------------------

Matrix     : [[ 0.864274  0.        0.        0.      ]
              [ 0.        0.864274  0.        0.      ]
              [ 0.        0.        0.864274  0.      ]
              [ 0.        0.        0.        1.      ]]
Offset     : [ 0.  0.  0.  0.]