Add rgb2gray function.