diff --git a/README.rst b/README.rst index ffcf3903d..1300d7c0a 100644 --- a/README.rst +++ b/README.rst @@ -876,6 +876,18 @@ Images (276, 281, 3) +Spectral Images - Fichet et al. (2021) +************************************** + +.. code-block:: python + + components = colour.read_spectral_image_Fichet2021("Polarised.exr") + list(components.keys()) + +.. code-block:: text + + ['S0', 'S1', 'S2', 'S3'] + Look Up Table (LUT) Data ************************ diff --git a/colour/examples/io/examples_fichet2021.py b/colour/examples/io/examples_fichet2021.py new file mode 100644 index 000000000..542051a03 --- /dev/null +++ b/colour/examples/io/examples_fichet2021.py @@ -0,0 +1,32 @@ +""" +Showcases *Fichet, Pacanowski and Wilkie (2021)* +*OpenEXR Layout for Spectral Images* related examples. +""" + +import os +import tempfile + +import colour +from colour.utilities import message_box + +ROOT_RESOURCES = os.path.join( + os.path.dirname(__file__), "..", "..", "io", "tests", "resources" +) + +message_box('"Fichet, Pacanowski and Wilkie (2021)" Spectral Image Reading and Writing') + +message_box("Reading a spectral image.") +path = os.path.join(ROOT_RESOURCES, "Ohta1997.exr") +components, specification = colour.read_spectral_image_Fichet2021( + path, additional_data=True +) +print(components) +print(specification) + +print("\n") + +message_box("Writing a spectral image.") +_descriptor, path = tempfile.mkstemp(suffix=".exr") +colour.write_spectral_image_Fichet2021(components, path) # pyright: ignore +components = colour.read_spectral_image_Fichet2021(path) +print(components) diff --git a/docs/index.rst b/docs/index.rst index 4b8feaf64..fe0b31287 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -651,6 +651,18 @@ Images (276, 281, 3) +Spectral Images - Fichet et al. (2021) +************************************** + +.. code-block:: python + + components = colour.read_spectral_image_Fichet2021("Polarised.exr") + list(components.keys()) + +.. code-block:: text + + ['S0', 'S1', 'S2', 'S3'] + Look Up Table (LUT) Data ************************