comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » problem loading color palette
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: problem loading color palette [message #49445 is a reply to message #49404] Thu, 27 July 2006 07:18 Go to previous messageGo to previous message
Karl[1] is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL_IDLBridge in Virtual Machine
Next Topic: Re: OUPUT TRIGRID to ENVI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:05:30 PDT 2025

Total time taken to generate the page: 0.64037 seconds