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

Home » Public Forums » archive » Colors of a 24-bit Color Image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Colors of a 24-bit Color Image [message #14714] Mon, 22 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Kenneth P. Bowman (bowman@null.tamu) writes:

> Actually, some 24-bit devices do have writable color tables. This is the
> distinction between TrueColor and DirectColor visuals. I believe our
> SGI's have DirectColor visuals, but most of our other 24-bit hardware does
> not allow one to change the color maps.

This is true. Normally, a 24-bit TrueColor visual class is non-writable,
meaning that you can't change the values in the color table. UNIX
workstations (some of them) also offer a writable 24-bit visual class
called the DirectColor visual class.

The PC, as I learned much to my consternation in a class last week,
seems to be a bit of a hybrid. Here is what I learned:

If you have a 24-bit image, such as the rose.dat dataset in the
IDL examples directory:

file = Filepath(SubDir='[examples', 'data'], 'rose.dat')
Read_JPEG, file, image24

Then you imagine that the "colors" are built into the data itself.
There is no reason to use a color look-up table. So that if you
issue a command like this:

TV, image24, True=1

You expect to see the image as it is meant to be seen. But
this is not so on a PC set in 24-bit color and running IDL
5.2.

In this case, what you see depends upon which color table you
have loaded and the current state of the DECOMPOSED keyword
to the DEVICE command.

The command above produces accurate color only if (1) the
gray-scale color table is loaded (LOADCT, 0) or (2) the
DECOMPOSED keyword is set equal to 1. If color decomposition
is OFF, and a color table is loaded, then IDL apparently runs
the RGB color values of the image through the color table to
get display colors.

LoadCT, 5
Device, Decomposed=0
TV, image24, True=1

While it might be possible to argue that this works as expected
(I.e., this is what it "means" to turn color decomposition off),
I would argue that this is *never* what I want. What it means,
of course, is that in my code if I display *any* 24-bit color
image, then I have to first make sure either the gray-scale color
table is loaded or I have to set the DECOMPOSED keyword:

Device, Decomposed=1
TV, image24, True=1

If I have to do that, why not have a DECOMPOSED keyword for the
TV command:

TV, image24, Decomposed=1, True=1

But isn't that duplicating what I already set with the TRUE
keyword? If I have a 24-bit image, then I want it displayed in
*those* colors and not some others.

I'm going to suggest to RSI that they may want to give this
situation some more attention. But I thought I would mention it
here in the hopes of saving others some small amount of
frustration. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Previous Topic: Passing a structured variable as an argument of procedure
Next Topic: Getting File creation data/time

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

Current Time: Fri Oct 10 15:36:15 PDT 2025

Total time taken to generate the page: 0.24028 seconds