How can I accurately display the colors of this indexed TIF image in MATLAB?
8 views (last 30 days)
Show older comments
I have a collection of images which are TIFs. I am attaching the output of iminfo for one of the files in question (iminfo.txt).
The problem I am trying to solve is that Windows image viewer displays the files differently than MATLAB, as shown HERE. I want the images to look as they do in the windows image viewer, and I will be incorporating them into a GUI later.
The above image is the result of this code:
overallImage = imread('trace7_ave.tif');
show_TIF_GUI, image(overallImage)
axis image
I have also tried this code, in which the tif displays as a completely black square (which is the same thing that happens if I try to open the tif in GIMP; I am sure this is no coincidence.) This is modeled after an example in the help file for imread:
[X,cmap] = imread('trace7_ave.tif');
imshow(X,cmap);
And finally, I have tried the following code, which displays in greyscale:
Y = imread('trace7_ave.tif');
imshow(Y);
I also understand that image and imshow are different commands, but you will see I have tried variations of both above. My guess is that I need to use imshow so I can handle the color mapping correctly, but I am unsure how to do that.
Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!