Re: colors of images [message #7684] |
Wed, 11 December 1996 00:00 |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Rafael Gallego wrote:
>
> Hi!
>
> I have done a program which generates in each time step three matrix.
> I want to plot all of them in the same image in each time step in such
> way that I can see the film of the system evolution. My problem arises
> with the colors for each array. I wanted that, say the array A1, was
> ploted with the color red, the array A2 with the green one and the array
> A3 with the blue one. The intensity of each color of course would be
> scaled with the respective array values. Then, I would see red a region
> in which A1 dominates, for instance. If it had a mixture of A1, A2 and
> A3, I would see a mixture of the three colors, red, green and blue. And
> this for each time step. My question is very simple:
>
> How can I accomplish what I want to do ?
>
> Thanks in advance and sorry for my English. I am not used to writting in
> English.
I'll take a guess that you are using an 8 bit display. If this guess is
correct, the COLOR_QUAN function is what your looking for. See the
online documentation.
On the other hand, if you have a 24-bit display, all you need is
something along the lines of
TV, R, CHANNEL=1
TV, G, CHANNEL=2
TV, B, CHANNEL=3
See the documentation for "true-color displays".
--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
|
|
|
Re: colors of images [message #7695 is a reply to message #7684] |
Tue, 10 December 1996 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Rafael Gallego <rafa@hp1.uib.es> writes:
> Hi!
> I have done a program which generates in each time step three matrix.
> I want to plot all of them in the same image in each time step in such
> way that I can see the film of the system evolution. My problem arises
> with the colors for each array. I wanted that, say the array A1, was
> ploted with the color red, the array A2 with the green one and the array
> A3 with the blue one. The intensity of each color of course would be
> scaled with the respective array values. Then, I would see red a region
> in which A1 dominates, for instance. If it had a mixture of A1, A2 and
> A3, I would see a mixture of the three colors, red, green and blue. And
> this for each time step. My question is very simple:
> How can I accomplish what I want to do ?
> Thanks in advance and sorry for my English. I am not used to writting in
> English.
Simply define a color table which uses different parts for different images.
For example:
nc = !d.nc / 3 ;One third of the color table
r=intarr(3*nc) & g=r & b=r ;Initialize color tables
x = 256*indgen(nc) / nc ;Generic color scale
r(0) = x ;First third is red
g(nc) = x ;Second third is green
b(2*nc) = x ;Last third is blue
tvlct, r, g, b ;Load the color tables
tv,bytscl(i1,top=nc),0 ;Display first image
tv,bytscl(i2,top=nc)+nc,1 ;Display second image
tv,bytscl(i3,top=nc)+2*nc,2 ;Display last image
Bill Thompson
|
|
|