colour.read_LUT#
- colour.read_LUT(path: str | PathLike, method: LiteralLUTReadMethod | str | None = None, **kwargs: Any) LUT1D | LUT3x1D | LUT3D | LUTSequence | LUTOperatorMatrix[source]#
Read the specified LUT file.
- Parameters:
method (LiteralLUTReadMethod | str | None) – Reading method, if None, the method will be auto-detected according to extension.
kwargs (Any)
- Returns:
colour.LUT1Dorcolour.LUT3x1Dorcolour.LUT3Dorcolour.LUTSequenceorcolour.LUTOperatorMatrixclass instance.- Return type:
colour.LUT1Dorcolour.LUT3x1Dorcolour.LUT3Dorcolour.LUTSequenceorcolour.LUTOperatorMatrix- Raises:
ValueError – If the LUT file format is not supported or if reading fails.
References
[AdobeSystems13], [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.]