colour.normalised_primary_matrix

colour.normalised_primary_matrix(primaries, whitepoint)[source]

Computes the Normalised Primary Matrix (NPM) converting a RGB colourspace array to CIE XYZ tristimulus values using given primaries and whitepoint \(xy\) chromaticity coordinates.

Parameters
  • primaries (array_like, (3, 2)) – Primaries \(xy\) chromaticity coordinates.

  • whitepoint (array_like) – Illuminant / whitepoint \(xy\) chromaticity coordinates.

Returns

Normalised Primary Matrix (NPM).

Return type

ndarray, (3, 3)

References

[SocietyoMPaTEngineers93]

Examples

>>> p = np.array([0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700])
>>> w = np.array([0.32168, 0.33767])
>>> normalised_primary_matrix(p, w)  
array([[  9.5255239...e-01,   0.0000000...e+00,   9.3678631...e-05],
       [  3.4396645...e-01,   7.2816609...e-01,  -7.2132546...e-02],
       [  0.0000000...e+00,   0.0000000...e+00,   1.0088251...e+00]])