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

Home » Public Forums » archive » Re: working with colours
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: working with colours [message #37647] Tue, 13 January 2004 08:46
maarten is currently offline  maarten
Messages: 30
Registered: April 2002
Member
thanks very much!
it all works great now
Re: working with colours [message #37648 is a reply to message #37647] Tue, 13 January 2004 08:14 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
maarten" <user@domain.invalid> wrote in message
news:4003EF71.5070201@domain.invalid...
> I have a problem with working with colours. I have two datasets that
> will be layed on eachother. One of the datasets will be displayed in
> greyvalues, the other will have to be displayed in a blue-red activation
> colourscheme, transparancy isn't needed. I tried to divide the
> colourspace in two separate parts using the bytscl command. But then all
> the colours of my linux environment are changed. Is there a way to avoid
> this, and also to be able apply the colourscheme to just one window,
> leaving the other windows in greyscale?

Download my IMDISP program from

http://www.gumley.com/PIP/Free_Software.html

and try this:

;- Gray scale image
window, /free
loadct, 0, bottom=0, ncolors=64
imdisp, dist(256), bottom=0, ncolors=64

;- Blue/red image
window, /free
loadct, 11, bottom=64, ncolors=64
imdisp, dist(256), bottom=64, ncolors=64

If the colors don't turn out as expected, then exit IDL, and save the
following commands in a file named $HOME/idl_startup.pro:

if !version.os_family eq 'unix' then device, true_color=24
window, /free, /pixmap, colors=-10
wdelete, !d.window
device, decomposed=0, retain=2, set_character_size=[10, 12]
device, get_visual_depth=depth
print, 'Display depth: ', strcompress(depth)
print, 'Color table size: ', strcompress(!d.table_size)


Use this file as your IDL startup file by setting the IDL_STARTUP
environment variable, and start a new IDL session, e.g.

% setenv IDL_STARTUP $HOME/idl_startup.pro
% idl

Now try the image display commands again.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: working with colours [message #37651 is a reply to message #37648] Tue, 13 January 2004 07:05 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maarten writes:

> I checked the number of colors in IDL, but this is only 256. is it
> possible to make this number higher and would this solve the problem?

Yes, make the number 16.7 million. :-)

Cheers,

David

P.S. What kind of graphics card does this machine have?
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
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: working with colours [message #37652 is a reply to message #37651] Tue, 13 January 2004 06:49 Go to previous message
maarten is currently offline  maarten
Messages: 30
Registered: April 2002
Member
Pepijn Kenter wrote:
>
>
> maarten wrote:
>
>> Hello,
>>
>> I have a problem with working with colours. I have two datasets that
>> will be layed on eachother. One of the datasets will be displayed in
>> greyvalues, the other will have to be displayed in a blue-red
>> activation colourscheme, transparancy isn't needed. I tried to divide
>> the colourspace in two separate parts using the bytscl command.
>
>
> It's possible that I misunderstand your problem or that you allready
> thought of the following solution, but it seems to me that you can map
> the first parameter to the Value, and the second parameter to the Hue in
> the HSV (or HSL) color coordinate system. You can use the color_convert
> routine from IDL to convert this HSV color to an RGB value, and then
> display the result as normal.
>
> HTH, Pepijn.
>

I checked the number of colors in IDL, but this is only 256. is it
possible to make this number higher and would this solve the problem?
regards maarten
Re: working with colours [message #37653 is a reply to message #37652] Tue, 13 January 2004 06:29 Go to previous message
Pepijn Kenter is currently offline  Pepijn Kenter
Messages: 31
Registered: April 2002
Member
maarten wrote:
> Hello,
>
> I have a problem with working with colours. I have two datasets that
> will be layed on eachother. One of the datasets will be displayed in
> greyvalues, the other will have to be displayed in a blue-red activation
> colourscheme, transparancy isn't needed. I tried to divide the
> colourspace in two separate parts using the bytscl command.

It's possible that I misunderstand your problem or that you allready
thought of the following solution, but it seems to me that you can map
the first parameter to the Value, and the second parameter to the Hue in
the HSV (or HSL) color coordinate system. You can use the color_convert
routine from IDL to convert this HSV color to an RGB value, and then
display the result as normal.

HTH, Pepijn.
Re: working with colours [message #37655 is a reply to message #37653] Tue, 13 January 2004 05:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maarten writes:

> I have a problem with working with colours. I have two datasets that
> will be layed on eachother. One of the datasets will be displayed in
> greyvalues, the other will have to be displayed in a blue-red activation
> colourscheme, transparancy isn't needed. I tried to divide the
> colourspace in two separate parts using the bytscl command. But then all
> the colours of my linux environment are changed. Is there a way to avoid
> this, and also to be able apply the colourscheme to just one window,
> leaving the other windows in greyscale?

I think what you are talking about is 24-bit color.
It may be time for a graphics card update on your machine. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: cron jobs, calling IDL, X windows
Next Topic: IDL memory usage

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

Current Time: Wed Oct 08 13:45:30 PDT 2025

Total time taken to generate the page: 0.00424 seconds