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

Home » Public Forums » archive » Re: 8 to 24 bit conversion
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: 8 to 24 bit conversion [message #41683 is a reply to message #41679] Tue, 09 November 2004 15:49 Go to previous messageGo to previous message
Robert Barnett is currently offline  Robert Barnett
Messages: 70
Registered: May 2004
Member
Sorry I didn't press refresh on the newsgroup
How about this.


erase
; Load the color table (blue)
loadct, 2
; Draw something at x=0, y=0
tvscl, dist(100)
; Read the entire screen
image = tvrd()
; Read the look up table
tvlct, red, green, blue, /get
; Get the size of the snapshot of the screen
size = size(image)
; Assign a rgb image
rgb = bytarr(3,size[1],size[2])
; Fill in each channel based on the byte value of the image
rgb[0,*,*] = red[image]
rgb[2,*,*] = blue[image]
rgb[1,*,*] = green[image]
; Load a BW color table
loadct, 0
; Display each channel
tvscl, rgb, /true
;tvscl, rgb[0,0:100,0:100], 0 ; Red
;tvscl, rgb[1,0:100,0:100], 1 ; Green
;tvscl, rgb[2,0:100,0:100], 2 ; Blue

For some reason I have to swap the blue and green positions.



--

nrb@
Robbie Barnett
imag
Research Assistant
wsahs
Nuclear Medicine & Ultrasound
nsw
Westmead Hospital
gov
Sydney Australia
au
+61 2 9845 7223
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: z-buffer and /noerase ?
Next Topic: Advection routine?

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

Current Time: Fri Oct 10 18:58:44 PDT 2025

Total time taken to generate the page: 1.84355 seconds