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.
Valeriy Korostyshevskiy (2021). Grayscale to RGB Converter (https://www.mathworks.com/matlabcentral/fileexchange/13312-grayscale-to-rgb-converter), MATLAB Central File Exchange. Retrieved .
It is simple in two lines:
[tmpng cmap] = rgb2ind(im);
[res] = ind2rgb(tmpng Newcmap);
very good program
worked great for me, i couldn't believe there wasn't a SIMPLE way to do this already. good work.
Its a beautiful code, excelent effort...
Allah Bless You...
Matlab already contains one (two) function to do this purpose. It is IND2RGB. Image Processing Tbx has a MEX (very fast and very
low memory overhead) called ind2rgb8.
Your function converts the UINT8 image to DOUBLES. This is a awfull memory consumption.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!