MATLAB: Mutilspectral image to RGB colormapmulti-spectralrgb I would like to convert the attached multispectral images to RGB in matlab. Please help with the code. Best Answer To simply put each image into one of the R, G or B-layers of an RGB-image just do this:img = peaks(12); % just something to give img1 = img; % us three differentimg2 = img1*0.7; % images with differentimg3 = img2*0.7; % intensitiesC1 = 1; % Possible C2 = 1; % intensityC3 = 1; % scaling-factorsrgbimg = cat(3,img1*C1,img2*C2,img3*C3);Now matlab expects RGB-images in double format to be between 0 and 1 to display them with functions like imagesc, so you might want to rescale rgbimg:rgbimg = (rgbimg - min(rgbimg(:)))/(max(rgbimg(:)) - min(rgbimg(:)));HTH Related SolutionsMATLAB: Matlab imshow this gives an error with imsubstract because the images are not of the same size. MATLAB: Read and display RGB png/jpg image You png file is actually an indexed image with a colormap. You can see it in color using following statements[img, map] = imread('image.png');imshow(img, map)or, you convert it to rgb, you can use ind2rgb()[img, map] = imread('image.png');img_rgb = ind2rgb(img, map);imshow(img_rgb) Related QuestionOverlay binary image on RGB imageHow can we map binary image on original RGB imageProblem of color display in an image
Best Answer