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

Home » Public Forums » archive » 8 to 24 bit conversion
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
8 to 24 bit conversion [message #41688] Tue, 09 November 2004 14:31
KM is currently offline  KM
Messages: 29
Registered: October 2004
Junior Member
I am trying to convert an 8 bit image created in the Z buffer to a
24 bit image. Is this possible? I would think so. But I am having
trouble getting it to work.

I based my code off of this algorithm:
http://groups.google.com/groups?hl=en&lr=&selm=c0jq0 j%24i40%241%40nntp6.u.washington.edu
But I don't want to use the COLOR_QUAN bit of code that reduces it
back to 8 bits.

Can anyone point me to a library that does this, or point out some
of the errors in the code below? Please don't point out the
embarrassing optimization errors I know are there...

Thanks

-k.


image = TVRD()
TVLCT, R, G, B, /GET

s = SIZE(image, /DIMENSIONS)
rImage = BYTARR(s)
gImage = BYTARR(s)
bImage = BYTARR(s)
; replace this section with a HISTOGRAM statement
for n=0, 255 do begin
idx = WHERE(image eq n, count)
if (count gt 0) then begin
rImage[idx] = R[n]
gImage[idx] = G[n]
bImage[idx] = B[n]
endif
endfor

newImage = bytarr( s(0), s(1), 3 )
newImage[*,*,0] = rImage
newImage[*,*,1] = gImage
newImage[*,*,2] = bImage
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: GIF compression support in ImageMagick - Re-Post
Next Topic: Using !P.Multi for TVSCL,CONGRID

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

Current Time: Fri Oct 10 00:36:34 PDT 2025

Total time taken to generate the page: 0.23783 seconds