Re: Inexplicable tvrd() behavior [message #52810] |
Fri, 02 March 2007 13:00 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
BillG writes:
> Can some one explain this behavior and offer a solution?
>
> In direct graphics, indexed color mode,
> 1. I create a color plot in a window,
> 2. read in back in with image1=tvrd()
> 3. plot it again in another window.
>
> I would expect (want) that the two windows would be identical but they
> appear quite different: the image in the second window appears to be
> (image1*4 < 255). The following program illustrates the problem.
>
> (Why indexed color? I want to create an color indexed png of the image
> but the resulting png looks like the image in window2)
> (Usual disclaimer: there is an explanation and solution obvious to
> anyone with any idl experience but its Friday, I have a
> headache , .... Also, I have read Fanning's Chapter 3 'Working with
> Color' to no avail)
The explanation is quite tedious, but is explained fully
here:
http://www.dfanning.com/color_tips/strange_tvrd.html
One solution is to make the window you are going to copy
the image out of in the Z-Graphics buffer rather than on your
display. That option is explained near the bottom of the
article above.
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.")
|
|
|