colour.quality.cqs Module

Colour Quality Scale

Defines colour quality scale computation objects:

References

[1]Davis, W., & Ohno, Y. (2010). Color quality scale. Optical Engineering, 49(3), 33602–33616. doi:10.1117/1.3360335
[2]Ohno, Y., & Davis, W. (2008). NIST CQS simulation 7.4. Retrieved from http://cie2.nist.gov/TC1-69/NIST CQS simulation 7.4.xls
class colour.quality.cqs.VS_ColorimetryData[source]

Bases: colour.quality.cqs.VS_ColorimetryData

Defines the the class holding VS test colour samples colorimetry data.

class colour.quality.cqs.VS_ColourQualityScaleData[source]

Bases: colour.quality.cqs.VS_ColourQualityScaleData

Defines the the class holding VS test colour samples colour quality scale data.

class colour.quality.cqs.CQS_Specification[source]

Bases: colour.quality.cqs.CQS_Specification

Defines the CQS colour quality specification.

Parameters:
  • Q_a (numeric) – Colour quality scale \(Q_a\).
  • Q_f (numeric) – Colour fidelity scale \(Q_f\) intended to evaluate the fidelity of object colour appearances (compared to the reference illuminant of the same correlated colour temperature and illuminance).
  • Q_p (numeric) – Colour preference scale \(Q_p\) similar to colour quality scale \(Q_a\) but placing additional weight on preference of object colour appearance. This metric is based on the notion that increases in chroma are generally preferred and should be rewarded.
  • Q_g (numeric) – Gamut area scale \(Q_g\) representing the relative gamut formed by the (\(a^*\), \(b^*\)) coordinates of the 15 samples illuminated by the test light source in the CIE LAB object colourspace.
  • Q_d (numeric) – Relative gamut area scale \(Q_d\).
  • Q_as (dict) – Individual CQS data for each sample.
  • colorimetry_data (tuple) – Colorimetry data for the test and reference computations.
colour.quality.cqs.colour_quality_scale(spd_test, additional_data=False)[source]

Returns the colour quality scale of given spectral power distribution.

Parameters:
  • spd_test (SpectralPowerDistribution) – Test spectral power distribution.
  • additional_data (bool, optional) – Output additional data.
Returns:

Color quality scale.

Return type:

numeric or CQS_Specification

Examples

>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> spd = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> colour_quality_scale(spd)  
64.6860580...
colour.quality.cqs.gamut_area(Labs)[source]

Returns the gamut area \(G\) covered by given CIE Lab matrices.

Parameters:Labs (array_like) – CIE Lab colourspace matrices.
Returns:Gamut area \(G\).
Return type:numeric

Examples

>>> Labs = [
...     np.array([39.94996006, 34.59018231, -19.86046321]),
...     np.array([38.88395498, 21.44348519, -34.87805301]),
...     np.array([36.60576301, 7.06742454, -43.21461177]),
...     np.array([46.60142558, -15.90481586, -34.64616865]),
...     np.array([56.50196523, -29.5465555, -20.50177194]),
...     np.array([55.73912101, -43.39520959, -5.08956953]),
...     np.array([56.2077687, -53.68997662, 20.2113441]),
...     np.array([66.16683122, -38.64600327, 42.77396631]),
...     np.array([76.7295211, -23.9214821, 61.04740432]),
...     np.array([82.85370708, -3.98679065, 75.43320144]),
...     np.array([69.26458861, 13.11066359, 68.83858372]),
...     np.array([69.63154351, 28.24532497, 59.45609803]),
...     np.array([61.26281449, 40.87950839, 44.97606172]),
...     np.array([41.62567821, 57.34129516, 27.4671817]),
...     np.array([40.52565174, 48.87449192, 3.4512168])]
>>> gamut_area(Labs)  
8335.9482018...