Colour Science for Python

colour-science.org ↗

Calculate colour from spectral samples and compare the results in Python.

SI Score
80/100
Pricing
Open Source AI reading, not confirmed
Free plan
Not confirmed
Sign-up required
Not confirmed

Ask SI about Colour Science for Python

Answers use saved listing facts and recorded sources.
Homepage screenshot
Screenshot of the Colour Science for Python homepage

What it does

Colour is a Python package of colour-science algorithms and datasets, freely available under BSD-3-Clause terms. Its tutorials connect spectral measurements, standard observers and illuminants with numeric colours and plots.

Install the colour-science package, then represent wavelength/value samples with SpectralDistribution. The tutorial selects a standard observer and D65 illuminant, calculates CIE XYZ values and converts them to a display swatch. This provides a reproducible route from measured samples to a visual comparison.

The numeric domains matter: the demonstrated spectral-to-XYZ calculation returns values on a 0-to-100 scale, while the sRGB conversion expects 0-to-1 input. The example rescales before converting.

Interpolation can change the stored spectral data in place, so copy the distribution before trying another wavelength interval. Optional plotting dependencies provide spectral graphs, colour swatches and chromaticity diagrams; they are separate from the core package requirements.

Strengths

  • Algorithms and reference datasets can be combined in repeatable scripts.
  • Tutorials show both numeric results and plotted comparisons.

Watch out for

  • Calculation inputs and numeric scales require care.
  • Interpolation can modify the original data object.

Best for

  • Developers and researchers performing repeatable colour calculations

Sources