Input and Output (IO)#

Image IO#

colour

READ_IMAGE_METHODS

Supported image read methods.

read_image(path[, bit_depth, method])

Read the image data at given path using given method.

WRITE_IMAGE_METHODS

Supported image write methods.

write_image(image, path[, bit_depth, method])

Write given image data at given path using given method.

Ancillary Objects

colour.io

Image_Specification_Attribute(name, value, type_)

Define an image specification attribute.

MAPPING_BIT_DEPTH

Implement a delimiter and case-insensitive dict-like object with support for slugs, i.e., SEO friendly and human-readable version of the keys but also canonical keys, i.e., slugified keys without delimiters.

image_specification_OpenImageIO(width, ...)

Create an OpenImageIO image specification.

convert_bit_depth(a[, bit_depth])

Convert given array to given bit-depth, the current bit-depth of the array is used to determine the appropriate conversion path.

read_image_OpenImageIO(path[, bit_depth, ...])

Read the image data at given path using OpenImageIO.

write_image_OpenImageIO(image, path[, ...])

Write given image data at given path using OpenImageIO.

read_image_Imageio(path[, bit_depth])

Read the image data at given path using Imageio.

write_image_Imageio(image, path[, bit_depth])

Write given image data at given path using Imageio.

as_3_channels_image(a)

Convert given array \(a\) to a 3-channels image-like representation.

Spectral Image - Fichet et al. (2021)#

colour

Specification_Fichet2021(path, components, ...)

Define the Fichet et al. (2021) spectral image specification.

read_spectral_image_Fichet2021(path[, ...])

Read the Fichet et al. (2021) spectral image at given path using OpenImageIO.

write_spectral_image_Fichet2021(components, path)

Write given Fichet et al. (2021) components to given path using OpenImageIO.

Ancillary Objects

colour.io

ComponentsFichet2021

alias of Dict[str | float, Tuple[ndarray[Any, dtype[float16 | float32 | float64]], ndarray[Any, dtype[float16 | float32 | float64]]]]

sd_to_spectrum_attribute_Fichet2021(sd[, ...])

Convert a spectral distribution to a spectrum attribute value according to Fichet et al. (2021).

spectrum_attribute_to_sd_Fichet2021(...)

Convert a spectrum attribute value to a spectral distribution according to Fichet et al. (2021).

OpenColorIO Processing#

colour.io

process_image_OpenColorIO(a, *args, **kwargs)

Process given image data with OpenColorIO.

Look Up Table (LUT) Data#

colour

LUT1D([table, name, domain, size, comments])

Define the base class for a 1D LUT.

LUT3x1D([table, name, domain, size, comments])

Define the base class for a 3x1D LUT.

LUT3D([table, name, domain, size, comments])

Define the base class for a 3D LUT.

LUTOperatorMatrix([matrix, offset])

Define the LUT operator supporting a 3x3 or 4x4 matrix and an offset vector.

LUTSequence(*args)

Define the base class for a LUT sequence, i.e., a series of LUTs, LUT operators or objects implementing the colour.hints.ProtocolLUTSequenceItem protocol.

read_LUT(path[, method])

Read given LUT file using given method.

write_LUT(LUT, path[, decimals, method])

Write given LUT to given file using given method.

Ancillary Objects

colour.io

AbstractLUTSequenceOperator([name, comments])

Define the base class for LUT sequence operators.

LUT_to_LUT(LUT, cls[, force_conversion])

Convert given LUT to given cls class instance.

read_LUT_Cinespace(path)

Read given Cinespace .csp LUT file.

write_LUT_Cinespace(LUT, path[, decimals])

Write given LUT to given Cinespace .csp LUT file.

read_LUT_IridasCube(path)

Read given Iridas .cube LUT file.

write_LUT_IridasCube(LUT, path[, decimals])

Write given LUT to given Iridas .cube LUT file.

read_LUT_SonySPI1D(path)

Read given Sony .spi1d LUT file.

write_LUT_SonySPI1D(LUT, path[, decimals])

Write given LUT to given Sony .spi1d LUT file.

read_LUT_SonySPI3D(path)

Read given Sony .spi3d LUT file.

write_LUT_SonySPI3D(LUT, path[, decimals])

Write given LUT to given Sony .spi3d LUT file.

CSV Tabular Data#

colour

read_sds_from_csv_file(path, **kwargs)

Read the spectral data from given CSV file and returns its content as a dict of colour.SpectralDistribution class instances.

read_spectral_data_from_csv_file(path, **kwargs)

Read the spectral data from given CSV file in the following form.

write_sds_to_csv_file(sds, path)

Write the given spectral distributions to given CSV file.

IES TM-27-14 Data#

colour

SpectralDistribution_IESTM2714([path, ...])

Define a IES TM-27-14 spectral distribution.

UPRTek and Sekonic Spectral Data#

colour

SpectralDistribution_UPRTek(path, **kwargs)

Implement support to read and write IES TM-27-14 spectral data XML file from a UPRTek Pseudo-XLS file.

SpectralDistribution_Sekonic(path, **kwargs)

Implement support to read and write IES TM-27-14 spectral data XML file from a Sekonic CSV file.

X-Rite Data#

colour

read_sds_from_xrite_file(path)

Read the spectral data from given X-Rite file and returns it as a dict of colour.SpectralDistribution class instances.