Re: problem loading color palette [message #49445 is a reply to message #49404] |
Thu, 27 July 2006 07:18   |
Karl[1]
Messages: 79 Registered: October 2005
|
Member |
|
|
The discussion about the arguments to write_tiff does not answer the
original question.
The palette loaded with loadct, xloadct, or tvlct does not
automatically get applied to your data when you write it to an output
file with write_tiff. The palette is for display purposes only. I'm
not sure how you came to the conclusion that write_tiff would translate
your image data stored in the map variable through the display device's
palette.
What you probably want to do is to get the contents of the palette with
TVLCT, /GET. Then, use your data in the 'map' variable to lookup the
R, G, and B values and write the result to the tiff file.
Something like:
TVLCT, r, g, b, /get
red = r[map]
green = g[map]
blue = b[map]
You now have the 3-channel RGB image in red, green, and blue.
aetherlux wrote:
> Well, I don't know how it works for IDL 6.3 but in IDL 6.0 Write_tiff
> supports several arguments. My whole Write_tiff is:
>
> Write_tiff,myfile,map,4,orientation=3
>
> It is a trick that I had found surfing the internet to get the correct
> orientation for my output file.
> Moreover I use the arguments "xresol=***" and "yresol=***" to indicate
> the resolution of the file, where *** is the resolution.
>
> Ben Tupper wrote:
>> aetherlux wrote:
>>
>>>>
>>>> > I have a bigger problem, now the image is showed with right colors, but
>>>> > the my output file with this map in yet saved with the default colors.
>>
>>>> Sorry, I don't know what you mean by "output file". You'll need to say
>>>> how you created it.
>>>>
>>>> Karl
>>>
>>> I have got to solve the problem. It works fine but yet with the window
>>> placed to the left of the screen.
>>> Before issuing any graphics command:
>>>
>>> device, /install_colormap
>>> device, true_color=24
>>> device, decomposed=0
>>> xloadct
>>>
>>> now you can choose your favourite palette.
>>>
>>> About the "output file": I write a tiff file to disk to save the
>>> obtained graphic:
>>>
>>> myfile='/home/user/map.tif'
>>> write_tiff,myfile,map,4
>>>
>>>
>>
>> Hi,
>>
>> WRITE_TIFF is expecting only one or two argument according to the IDL
>> online docs (IDL 6.3). What are you trying to do with the third
>> argument (4) that you have shown?
>>
>> Ben
|
|
|