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

Home » Public Forums » archive » Re: Converting 8-bit image + pallete to 24 bit image with alpha channel
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Converting 8-bit image + pallete to 24 bit image with alpha channel [message #19308 is a reply to message #19304] Thu, 09 March 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ricardo Fonseca (zamb@physics.ucla.edu) writes:

> I'm trying to convert an 8-bit grayscale image to a 24 bit image with an
> alpha channel, mapping the colors of the 8-bit image through a palette.
> Right now I'm doing it like this:
>
> CT = 23
> LoadCT,CT
> TVLCT, rr, gg, bb, /get
>
> Data = BytScl(Abs(Data), MAX = max, MIN = min)
> s = Size(Data)
> AlphaImage = BytArr(4, s[1], s[2])
> AlphaImage[0,*,*] = rr(Data[*,*])
> AlphaImage[1,*,*] = gg(Data[*,*])
> AlphaImage[2,*,*] = bb(Data[*,*])
> AlphaImage[3,*,*] = 128
>
> Which works, but I was wondering if there was a more efficient way of doing
> this. Can anyone help?

That's about the size of it, I'm afraid. :-(

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
Read Message
Previous Topic: Re: IDL and Linux on dual processor
Next Topic: Corruption of string variable in IDL V5.3

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

Current Time: Sun Oct 12 14:45:57 PDT 2025

Total time taken to generate the page: 2.48305 seconds