Hello,
For your READ_TIFF command, "read_tiff(myfile, r, g, b)", this assumes that "myfile" contains a color palette (color table). If that is not the case the R, G and B will not be defined. You can determine if your TIFF file has a color palette with a commands like:
!null = query_tiff(myfile, info)
print, info.has_palette ? 'Has a color palette.' : 'No color palette.'
Here's an example using the "examples.tif" file which is included with an IDL installation:
IDL> file = filepath('examples.tif',subdir=['examples','data'])
IDL> print, file
C:\Program Files\Exelis\IDL85\examples\data\examples.tif
IDL> print, query_tiff(file, info)
1
IDL> print, info.has_palette ? 'Has a color palette.' : 'No color palette.'
Has a color palette.
IDL> img = read_tiff(file, r, g, b)
% Loaded DLM: TIFF.
IDL> help, r, g, b
R BYTE = Array[256]
G BYTE = Array[256]
B BYTE = Array[256]
IDL> device, decomposed=0
IDL> tvlct, r, g, b
IDL> help, img
IMG BYTE = Array[375, 150]
IDL> window, xsize=375, ysize=150
IDL> tv, img, /order
Or with function graphics, just issue the commands:
file = filepath('examples.tif',subdir=['examples','data'])
img = image(file)
I hope this will be helpful.
Regards,
|