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

Home » Public Forums » archive » Re: Problems with color tables and write_png
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Problems with color tables and write_png [message #55880] Mon, 17 September 2007 14:58
kathryn.ksm is currently offline  kathryn.ksm
Messages: 10
Registered: April 2006
Junior Member
>> Colormap: Shared, 16777216 colors. Translation table: Enabled
>
> Well, "enabled" bothers me. And it could explain a great
> many of these odd problems, it seems to me. Is it possible
> you are running some kind of a startup file (either IDL
> or .cshrc or something) that is turning this translation
> table feature on? Maybe something you got from a friend who
> doesn't have your best interests at heart?
>
> Anyway, try this:
>
> DEVICE, BYPASS_TRANSLATION=0
>

Ah, that's intriguing... actually, I think DEVICE,
BYPASS_TRANSLATION=1 is what I want. I had DEVICE,
BYPASS_TRANSLATION=0 in a startup file that, indeed, I got from a
friend (who probably didn't have my best interests in mind). Almost
everything else in that startup file makes sense to me, but I had no
idea about this one. And bingo! That seems to be the trick. By
setting the bypass to 1 I got a png file that actually looks right! I
think that might have solved the problem....

Thanks so much! Phew!

Kathryn
Re: Problems with color tables and write_png [message #55881 is a reply to message #55880] Mon, 17 September 2007 14:47 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kathryn.ksm@gmail.com writes:

> Here's what I get:
> IDL> help, /device
> Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X
> Z
> Current graphics device: X
> Server: X11.0, The X.Org Foundation, Release 60802000
> Display Depth, Size: 24 bits, (1280,1024)
> Visual Class: TrueColor (4)
> Bits Per RGB: 8 (8/8/8)
> Physical Color Map Entries (Emulated / Actual): 256 / 256
> Colormap: Shared, 16777216 colors. Translation table: Enabled
> Graphics pixels: Decomposed, Dither Method: Ordered
> Write Mask: 16777215 (decimal) ffffff (hex)
> Graphics Function: 3 (copy)
> Current Font: <default>, Current TrueType Font: <default>
> Default Backing Store: Pixmap.

And you are physically sitting on this machine, right?
You aren't running over some kind of X window emulator
or anything?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Problems with color tables and write_png [message #55882 is a reply to message #55881] Mon, 17 September 2007 14:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kathryn.ksm@gmail.com writes:

>> You have problems. :-)
>
> Beyond being too stupid to understand IDL's colors?

I'm not sure these problems are of your own devising. :-)


>> Could you tell us, please, the result of the following
>> command:
>>
>> IDL> Help, /Device
>
> Here's what I get:
> IDL> help, /device
> Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X
> Z
> Current graphics device: X
> Server: X11.0, The X.Org Foundation, Release 60802000
> Display Depth, Size: 24 bits, (1280,1024)
> Visual Class: TrueColor (4)
> Bits Per RGB: 8 (8/8/8)
> Physical Color Map Entries (Emulated / Actual): 256 / 256
> Colormap: Shared, 16777216 colors. Translation table: Enabled

Well, "enabled" bothers me. And it could explain a great
many of these odd problems, it seems to me. Is it possible
you are running some kind of a startup file (either IDL
or .cshrc or something) that is turning this translation
table feature on? Maybe something you got from a friend who
doesn't have your best interests at heart?

Anyway, try this:

DEVICE, BYPASS_TRANSLATION=0

Now do colors make more sense to you. In particular,
TVREAD should now be able to make a PNG of what is in
your window without difficulty.

IDL> void = TVREAD(/PNG)

Let us know.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Problems with color tables and write_png [message #55883 is a reply to message #55882] Mon, 17 September 2007 13:54 Go to previous message
kathryn.ksm is currently offline  kathryn.ksm
Messages: 10
Registered: April 2006
Junior Member
> You have problems. :-)

Beyond being too stupid to understand IDL's colors?

>
> Could you tell us, please, the result of the following
> command:
>
> IDL> Help, /Device

Here's what I get:
IDL> help, /device
Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X
Z
Current graphics device: X
Server: X11.0, The X.Org Foundation, Release 60802000
Display Depth, Size: 24 bits, (1280,1024)
Visual Class: TrueColor (4)
Bits Per RGB: 8 (8/8/8)
Physical Color Map Entries (Emulated / Actual): 256 / 256
Colormap: Shared, 16777216 colors. Translation table: Enabled
Graphics pixels: Decomposed, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Pixmap.

I should note that I have problems like this whenever I use any form
of color table. I routinely make contour plots with a greyscale
colortable, and when I write those to png files, the background always
goes blue. Not such a big deal there, but when I am trying to use the
colors to represent things, I have trouble.

Thanks!

Kathryn
Re: Problems with color tables and write_png [message #55884 is a reply to message #55883] Mon, 17 September 2007 13:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
kathryn.ksm@gmail.com writes:

> I think I'm in over my head with IDL's color handling, and I would be
> so grateful for any help!

You have problems. :-)

Could you tell us, please, the result of the following
command:

IDL> Help, /Device

Thanks,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problems with color tables and write_png
Next Topic: Adding Widgets to ENVI

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

Current Time: Thu Oct 09 21:20:06 PDT 2025

Total time taken to generate the page: 0.12123 seconds