Of course this is not about converting an RGB to grayscale.
In most photo-editing software like Photoshop and Affinity etc, there is an option to go from a regular color photo to a black and white photo. Often this is done by a control like the image below that allows you to control the contribution of each color group (Red, Yellow, Green, Cyan, Blue, Magenta) to the final image.
My question is given an RGB image, how would one generate the black and white image, while controlling the contribution of different colors?
What would the implementation look like?
A naive implementation would be like
gray = mean(r,g,b) and if you wanted to change contribution of each of the fundamental colors you may have
gray = mean(x*r,y*b,z*g) where
x+y+z=1 but who about r,g,b,c,m,y as it seems to be the norm?