Converting from RGB to CMY is simply the following
C =1 - R M =1 - G Y = 1 - B The reverse mapping is similarly obvious
R =1 - C G =1 - M B = 1 - Y The two system may also be known as additive for RGB and subtractive for CMY.
RGB to/from YIQ
The YIQ system is the colour primary system adopted by NTSC for colour television broadcasting. The YIQ color solid is formed by a linear transformation of the RGB cube. Its purpose is to exploit certain characteristics of the human visual system to maximize the use of a fixed bandwidth. The transform maxtrix is as follows