Hello, I have a grayscale TIF images (although it says it is TrueColor, nevermind). I need to convert them to grayscale and save it as it appears in imagesc(), colormap(jet) i.e. color picture.
Matlab code I use:
N = 4FNAMEFMT = 'Frame%d.tif';% Load images
for i=1:N IMAGES = imread(sprintf(FNAMEFMT, i)); IMAGES = rgb2gray(IMAGES); fname = sprintf('%s\\Frame%d.tif','C:\Project',i); imagesc(IMAGES); axis image; colorbar; colormap(jet); imwrite(IMAGES, fname, 'tif');end
The pictures I import to MATLAB looking like that: http://img845.imageshack.us/img845/531/frame1m.png
But the code I provided saves them again as black/white/gray.
Best Answer