Re: RGB image to 8 bit ?? [message #17030] |
Thu, 09 September 1999 00:00 |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
David Fanning wrote:
>
> Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:
>
>> Richard Tyc wrote:
>>> At this point, the image is a bytarr[3,512,512]
>>>
>>> In order to load it into Xinteranimate, it needs to be in
>>> bytarr[512,512] form ?
>>>
>>> So, how do you convert a RGB triple image into a single 8-bit image
>>> while retaining
>>> the colors (although lower resolution of color)
>>
>> pseudo = color_quan(image, 1, r, g, b, colors=!d.table_size)
>> device, decomposed=0
>> tvlct, r, g, b
>> tv, pseudo
>
> Be sure you know what you are doing with Color_Quan here.
> What you *don't* want to be doing is getting a different
> color table for each image frame.
Fair enough. However I've always used my frame tools for animation,
which allow a separate color table for each image
(http://cimss.ssec.wisc.edu/~gumley/frame.html).
That said, I also think a 24-bit capable version of XInteranimate would
be useful.
Cheers,
Liam.
--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Re: RGB image to 8 bit ?? [message #17031 is a reply to message #17030] |
Thu, 09 September 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:
> Richard Tyc wrote:
>> At this point, the image is a bytarr[3,512,512]
>>
>> In order to load it into Xinteranimate, it needs to be in
>> bytarr[512,512] form ?
>>
>> So, how do you convert a RGB triple image into a single 8-bit image
>> while retaining
>> the colors (although lower resolution of color)
>
> pseudo = color_quan(image, 1, r, g, b, colors=!d.table_size)
> device, decomposed=0
> tvlct, r, g, b
> tv, pseudo
Be sure you know what you are doing with Color_Quan here.
What you *don't* want to be doing is getting a different
color table for each image frame.
When I faced the same problem of 24-bit images in
XInterAnimate, I found it fairly trivial to modify the
XInterAnimate code to accept 24-bit images. Hey, here is
a suggestion for IDL 5.3. :-)
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
|
|
|
Re: RGB image to 8 bit ?? [message #17033 is a reply to message #17030] |
Thu, 09 September 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Richard Tyc wrote:
> At this point, the image is a bytarr[3,512,512]
>
> In order to load it into Xinteranimate, it needs to be in
> bytarr[512,512] form ?
>
> So, how do you convert a RGB triple image into a single 8-bit image
> while retaining
> the colors (although lower resolution of color)
pseudo = color_quan(image, 1, r, g, b, colors=!d.table_size)
device, decomposed=0
tvlct, r, g, b
tv, pseudo
Cheers,
Liam.
--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
|
|
|