gray2rgb

Turns an m by n matrix into an m x n x 3 matrix.
6.7K Downloads
Updated 2 Jul 2010

View License

This just makes a grayscale image, with values ranging from 0 to 255, into a RGB truecolor image with values ranging from 0 to 1 in each of the 3 colors. I wrote this so that I could outline the objects in a grayscale image with color borders.

Cite As

Gabriel Frangakis (2026). gray2rgb (https://nl.mathworks.com/matlabcentral/fileexchange/28111-gray2rgb), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Modify Image Colors in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0.0