View Full Version : color table questions

07-22-2011, 10:05 AM
It seems that WAVE can only load one color table in memory at any given time. All windows are statically linked to the loaded color table, so when you issue a plot or display an image which uses a new color table the existing windows update automatically and look psychedelic.


f = path + 'image-1_0\data\teluride24.jpg'

PLOT, FINDGEN(200)*0.1, RANDOMU(s, 200)
; image is psychedelic!

1st question; Is there any way to "freeze" the display of the image window so that it isn't affected by a later call to LOADCT?

2nd question: The color values of the JPG's color table are in a random order (just call COLOR_PALETTE after displaying it). Is there any way to retrieve the color palette indices in rainbow order (ROYGBIV)? Thanks.

07-22-2011, 11:01 AM
I think COLOR_CONVERT can be used to give me roughly what I want for question 2. Any idea on question 1?

07-23-2011, 12:29 PM
Which color model are you using? Please run the following command and respond with the output.

Info, /device

You're right, you should be using WOCOLORCONVERT for #2.


12-14-2011, 12:02 PM
I am having trouble loading a 24-bit image and drawing colorized lines on top of it in PV-WAVE. The colors have full range when I draw them without the background image. Once I add the image, they become "banded". Is this a limitation of PV-WAVE's drawing capabiliity?

The following statements are from the Reference Guide:

On a 24-bit workstation, each pixel on the screen can be displayed in any one of a possible 16.7 million (2^24) colors. The video memory on the machine is capable of addressing each pixel on the screen with a 24-bit value, “decomposed” to eight bits each for the red, green, and blue intensity values for that pixel.
Since each pixel in video memory directly references a set of three 8-bit red-green-blue intensities, there is no need for a color lookup table as in an 8-bit system. However, because PV-WAVE is an 8-bit colortable-based software package (instead of a “true” 24-bit software package), it performs similar conversions internally when drawing to a 24-bit display.

If I can't draw with all the colors I need, can I save them to a 24-bit image file? Or are the IMAGE_CREATE / IMAGE_WRITE functions also handicapped?

12-21-2011, 03:00 PM
Well, I went ahead and tried using IMAGE_WRITE, and I was suprised to find that it worked! The JPG image created is 24-bit and does not suffer from the same color-banding effects that happen when you use IMAGE_DISPLAY.