Re: how can I preserve colours when reading pixels with tvrd function [message #61846] |
Fri, 08 August 2008 03:49  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Aug 7, 7:55 am, David Fanning <n...@dfanning.com> wrote:
> bam writes:
>> I am using tvrd to capture the contents of an idl direct graphics
>> window [idl code: im=tvrd(0,0,500,500) ], on which I have a
>> combination of graphics, including plotted lines, xyouts text and a
>> background display of a byte array with a colortable. the output of
>> tvrd is a grayscale image that has lost all the colors in my original
>> window...
>> so how can i preserve the contents of my window and perhaps even save
>> it as a gif, without distorting the colors of my colortable?
>
> The short answer? Use TVREAD instead:
>
> IDL> void = TVRead(/GIF)
>
> You can find TVRead here:
>
> http://www.dfanning.com/programs/tvread.pro
>
> You can find the long answer inside the TVREAD code. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
...or you could pass the result of TVRD through TRUEIFY:
http://web.astroconst.org/jbiu/jbiu-doc/plot/trueify.html
-Jeremy.
|
|
|