colour.read_sds_from_xrite_file#

colour.read_sds_from_xrite_file(path: str | PathLike) Dict[str, SpectralDistribution][source]#

Read spectral data from the specified X-Rite file and convert it to a dict of colour.SpectralDistribution class instances.

Parameters:

path (str | PathLike) – Absolute X-Rite file path.

Returns:

dict of colour.SpectralDistribution class instances.

Return type:

dict

Raises:

IOError – If the file cannot be read.

Notes

  • This parser is minimalistic and absolutely not bullet-proof.

Examples

>>> import os
>>> from pprint import pprint
>>> xrite_file = os.path.join(
...     os.path.dirname(__file__),
...     "tests",
...     "resources",
...     "X-Rite_Digital_Colour_Checker.txt",
... )
>>> sds_data = read_sds_from_xrite_file(xrite_file)
>>> pprint(list(sds_data.keys()))
['X1', 'X2', 'X3', 'X4', 'X5', 'X6', 'X7', 'X8', 'X9', 'X10']