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

Home » Public Forums » archive » Re: changing the color map without having to re-load an image
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: changing the color map without having to re-load an image [message #29973] Wed, 03 April 2002 06:42 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Marc Sauvage (msauvage@cea.fr) writes:

> since I recently changed my work environment from an X-terminal
> running on a solaris network to a mac on OSX with Xfree86, I'm
> experiencing a strange problem with colors: I cannot modify the color
> map (e.g. with xloadct, or by loading a new table with the command
> line) and have these changes apply to the already displayed images.
> The changes will only affect the images I load after the change.
>
> I never experienced this problem in my previous configuration. The
> problem appears to be connected to the way I'm working now: I'm using
> Xdarwin (basically that's Xfree86 compiled form Mac OS X) to start an
> X session on the mac, then I connect to a solaris machine and run IDL
> there on remote.
>
> At first I couldn't even use colors, but searching around made me
> stumble on
>
> device,decompose=0
>
> Which solves this problem. So now I can use colors, any color table,
> in fact. I can modify the color table with xloadct, and I see the
> color table changing in the xloadct widget, but these changes do not
> affect the already opened graphics window and I have to reload the
> images to see the changes (I' ve tried setting retain to 2 but I don't
> think this addresses my problem). This is a pain because in my field,
> astronomy, I have to do this almost all the time to actually see
> what's in the images, and explore the structure of the objects.
>
> I checked on both the Mac and the unix server which types of visual
> were supported (with xpdyinfo) and apparently the same types are
> supported on both side. Currently I'm set to true_color. Also worth
> knowing: my version of IDL is 5.4.
>
> Anyone with ideas on how to solve this problem is welcome.

Welcome to the world of 24-bit color, Marc! :-)

What you are experiencing is perfectly normal, and
exactly they way 24-bit color is suppose to work. And
rest assured, after a bit of an adjustment you are going to
want to work in 24-bit color all the time, just like the
rest of us.

Here are a couple of articles you might want to read:

http://www.dfanning.com/color_tips/identical_graphics.html
http://www.dfanning.com/color_tips/noxloadct.html

Also, download my XCOLORS program and read the documentation
header, especially the information about the NOTIFY_PRO keyword.

http://www.dfanning.com/programs/xcolors.pro

Similar capabilities are built into XLOADCT, but they
are a bit more cumbersome, in my opinion.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: changing the color map without having to re-load an image [message #29976 is a reply to message #29973] Wed, 03 April 2002 01:46 Go to previous messageGo to next message
David Burridge is currently offline  David Burridge
Messages: 33
Registered: January 1998
Member
Hi Marc,

"Marc Sauvage" <msauvage@cea.fr> wrote in message
news:59bc2798.0204030112.6e521c7e@posting.google.com...
> Hi there,
>
> since I recently changed my work environment from an X-terminal
> running on a solaris network to a mac on OSX with Xfree86, I'm
> experiencing a strange problem with colors: I cannot modify the color
> map (e.g. with xloadct, or by loading a new table with the command
> line) and have these changes apply to the already displayed images.
> The changes will only affect the images I load after the change.
>
> I never experienced this problem in my previous configuration. The
> problem appears to be connected to the way I'm working now: I'm using
> Xdarwin (basically that's Xfree86 compiled form Mac OS X) to start an
> X session on the mac, then I connect to a solaris machine and run IDL
> there on remote.
>
> At first I couldn't even use colors, but searching around made me
> stumble on
>
> device,decompose=0
>
> Which solves this problem. So now I can use colors, any color table,
> in fact. I can modify the color table with xloadct, and I see the
> color table changing in the xloadct widget, but these changes do not
> affect the already opened graphics window and I have to reload the
> images to see the changes (I' ve tried setting retain to 2 but I don't
> think this addresses my problem). This is a pain because in my field,
> astronomy, I have to do this almost all the time to actually see
> what's in the images, and explore the structure of the objects.
>
> I checked on both the Mac and the unix server which types of visual
> were supported (with xpdyinfo) and apparently the same types are
> supported on both side. Currently I'm set to true_color. Also worth
> knowing: my version of IDL is 5.4.
>
> Anyone with ideas on how to solve this problem is welcome.
>
> Marc.

You are going to get a *ton* of answers to this when the USA wakes up in a
few hours - most of them far more expert than me:-) But, in case you're in
more of a hurry ....

It sounds to me like you were using 8-bit color before and now you've moved
up to 24-bit. My understanding of the decomposed=0 is that it sets up a
translation table so that 8-bit colormaps (e.g. those used by xloadct) will
work. Until then you normally get shades of red as you'll be accessing the
red part of the rgb colormap. The downside of this is that it makes the
image display a two-step process, so you have to redraw to reapply color
changes. This is why "smart" windows (that know how to redraw themselves)
and objects (ditto) have been popular for a while.

If you're really desperate, you might try downgrading the number of colors
your windows supports to 256 (yuk!), but before you do - the guru for this
stuff is Dave Fanning (who will no doubt pick up your message soon) and you
should *definitely* look at his site for utilities and programs in this area
(www.dfanning.com).

Good luck!

Dave
Re: changing the color map without having to re-load an image [message #30053 is a reply to message #29973] Wed, 03 April 2002 14:01 Go to previous message
Stein Vidar Hagfors H[1] is currently offline  Stein Vidar Hagfors H[1]
Messages: 56
Registered: February 2000
Member
David Fanning <david@dfanning.com> writes:

> Marc Sauvage (msauvage@cea.fr) writes:
[..]
>> Which solves this problem. So now I can use colors, any color table,
>> in fact. I can modify the color table with xloadct, and I see the
>> color table changing in the xloadct widget, but these changes do not
>> affect the already opened graphics window and I have to reload the
>> images to see the changes (I' ve tried setting retain to 2 but I don't
>> think this addresses my problem). This is a pain because in my field,
>> astronomy, I have to do this almost all the time to actually see
>> what's in the images, and explore the structure of the objects.
>>
>> I checked on both the Mac and the unix server which types of visual
>> were supported (with xpdyinfo) and apparently the same types are
>> supported on both side. Currently I'm set to true_color. Also worth
>> knowing: my version of IDL is 5.4.
>>
>> Anyone with ideas on how to solve this problem is welcome.
>
> Welcome to the world of 24-bit color, Marc! :-)

Yes, brave new world and all that. Wonderful progress we've had, when
you can no longer interactively modify and view the results of color
table changes without making or using a full-fledged
application... Sort of takes the I out of IDL, as I've said a few
times before. But I guess astronomers & fellow tinkerers are not the
main group of customers - if we had been, a proper system would have
been worked out (i.e. for any direct graphics window, you can
associate a certain color table, which you can modify independently of
the others. They do it in object graphics, but those are not really
something you'd like to play with from the IDL> prompt directly ;-)

By the way, on my system (1) I *can* do what you want (with some
pointing and clicking in the display windows after startind xloadct),
so it is quite platform/visual dependent.

(1)
{ sparc sunos unix 5.3 Nov 11 1999}
Current graphics device: X
Server: X11.0, Sun Microsystems, Inc., Release 6410
Display Depth, Size: 24 bits, (1280,1024)
Visual Class: DirectColor (5)
Bits Per RGB: 8
Physical Color Map Entries (Used / Total): 256 / 256
Colormap: Private, 16777216 colors. Translation table: Bypassed
Graphics pixels: Combined, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.
Window Status: ---------------------
id typ( x, y, backing store) id typ( x, y, backing store)
0: Win( 640, 512, Req from Server)



--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Vectorized STRMID ( was Re: Selecting odd/even numbered files)
Next Topic: testcase

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

Current Time: Wed Oct 08 13:42:43 PDT 2025

Total time taken to generate the page: 0.00677 seconds