How do I obtain colour difference components from tristimulus values?
Here is the block diagram for luma/colour difference encoding and decoding: From linear XYZ – or linear R1 G1 B1 whose chromaticity coordinates are different from the interchange standard – apply a 3 x 3 matrix transform to obtain linear RGB according to the interchange primaries. Apply a nonlinear transfer function (“gamma correction”) to each of the components to get nonlinear R’G’B’. Apply a 3 x 3 matrix to obtain colour difference components such as Y’PBPR , Y’CBCR or PhotoYCC. If necessary, apply a colour subsampling filter to obtain subsampled colour difference components. To decode, invert the above procedure: run through the block diagram right-to-left using the inverse operations. If your monitor conforms to the interchange primaries, decoding need not explicitly use a transfer function or the tristimulus 3 x 3. The block diagram emphasizes that 3 x 3 matrix transforms are used for two distinctly different tasks. When someone hands you a 3 x 3, you have to ask for which task i