colour.apply_matrix_colour_correction#
- colour.apply_matrix_colour_correction(RGB: ArrayLike, CCM: ArrayLike, method: Literal['Cheung 2004', 'Finlayson 2015', 'Vandermonde'] | str = 'Cheung 2004', **kwargs: Any) NDArrayFloat[source]#
Apply colour correction matrix \(CCM\) to the specified RGB colourspace array.
The colour correction matrix transforms the input RGB values through polynomial expansion and matrix multiplication to produce colour corrected output values. The computation method determines the polynomial expansion approach used before applying the matrix.
- Parameters:
RGB (ArrayLike) – RGB colourspace array to which the colour correction matrix \(CCM\) is applied.
CCM (ArrayLike) – Colour correction matrix \(CCM\).
method (Literal['Cheung 2004', 'Finlayson 2015', 'Vandermonde'] | str) – Computation method.
degree – {
colour.characterisation.apply_matrix_colour_correction_Finlayson2015(),colour.characterisation.apply_matrix_colour_correction_Vandermonde()}, Expanded polynomial degree, must be one of [1, 2, 3, 4] forcolour.characterisation.apply_matrix_colour_correction_Finlayson2015()definition.root_polynomial_expansion – {
colour.characterisation.apply_matrix_colour_correction_Finlayson2015()}, Whether to use the root-polynomials set for the expansion.terms – {
colour.characterisation.apply_matrix_colour_correction_Cheung2004()}, Number of terms of the expanded polynomial.kwargs (Any)
- Returns:
Colour corrected RGB colourspace array.
- Return type:
References
[CWCR04], [FMH15], [WR04], [Wikipedia03f]
Examples
>>> RGB = np.array([0.17224810, 0.09170660, 0.06416938]) >>> CCM = np.array( ... [ ... [1.05263767, 0.13780789, -0.22763399], ... [0.07395843, 1.02939945, -0.1060115], ... [0.05725508, -0.20526336, 1.10151945], ... ] ... ) >>> apply_matrix_colour_correction(RGB, CCM) array([ 0.1793456..., 0.1003392..., 0.0617218...])