grayscale function

Convert an RGB image to grayscale