gray2rgb

Turns an m by n matrix into an m x n x 3 matrix.

You are now following this Submission

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://www.mathworks.com/matlabcentral/fileexchange/28111-gray2rgb), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Modify Image Colors in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0