colour.RGB_to_YCoCg#

colour.RGB_to_YCoCg(RGB: ArrayLike) numpy.ndarray[source]#

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

Parameters

RGB (ArrayLike) – Input R’G’B’ array.

Returns

YCoCg colour encoding array.

Return type

numpy.ndarray

References

[MS03]

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])