Implement the functions saturate, desaturate, grayscale (#12758,
#12759).

Change-Id: Ie268a088c8d76f1f124eb52593fac236c387f300