Grayscale to RGB Converter

Convert grayscale images to RGB using a specified colormap.
Updated 11 Dec 2006

View License

The function converts grayscale images to RGB using a specified colormap. The default colormap is ``hot''. The graysale image is supplied either as a name or a matrix.


res = grs2rgb(im,cmap);

res is a size(im)-by-3 RGB image.

Cite As

Valeriy Korostyshevskiy (2024). Grayscale to RGB Converter (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Colormaps in Help Center and MATLAB Answers

Inspired by: Gray image to Color image conversion

Inspired: rgb2hex and hex2rgb

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Added html file