Converting 8-bit image + pallete to 24 bit image with alpha channel [message #19309] |
Thu, 09 March 2000 00:00 |
Ricardo Fonseca
Messages: 13 Registered: February 2000
|
Junior Member |
|
|
Hi
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?
Thanks in advance, Ricardo
|
|
|