colour.RGB_to_YCoCg

colour.RGB_to_YCoCg(RGB)[source]

Converts an array of R’G’B’ values to the corresponding YCoCg colour encoding values array.

Parameters:RGB (array_like) – Input R’G’B’ array.
Returns:YCoCg colour encoding array.
Return type:ndarray

References

[Malvar2003]

Examples

>>> RGB_to_YCoCg(np.array([1.0, 1.0, 1.0]))
array([ 1.,  0.,  0.])
>>> RGB_to_YCoCg(np.array([0.75, 0.5, 0.5]))
array([ 0.5625,  0.125 , -0.0625])