RGB2gray function

Convert RGB image or colormap to grayscale image