Converting images - grayscale and color

gray_to_rgb(gray, colormap) Returns single color vector or packed grayscale matrix gray converted to a packed color matrix using color palette matrix colormap.

rgb_to_gray(RGB) Returns packed RGB color matrix RGB converted to grayscale.

Arguments:

Alternatively, the functions described above can take three arguments, for example (R, G, B), where R, G, and B are scalars or matrices.