In article 1398@news.uit.no, roy@mack.uit.no (Roy Oestensen) writes:
> Does anybody have experience with constructing a true color image
> from three grayscale images (R+G+B) in IDL?
>
> I have several astronomical images that have been made in appropriate
> wavebands, and would very much like to construct real RGB images for
> publishing.
I have never made 24 bit images (but that should be fairly straightforward)
but I have made some "true" pseudo-color image from R G and B using the
COLOR_QUAN() function. I have attached a little sample code which does
this below... This is probably what you were looking for?
cheers,
Eric
>
> If anybody out there have the IDL programs that does this kind of stuff,
> please let me know!
>
>
> Roy OEstensen * E-mail: roy@mack.uit.no ** "Sometimes I think I
> Auroral Observatory * ** understand everything
> University of Tromsoe * PLEASE NOTE: The letters ** ---- Then I regain
> Norway * oe and OE is \o and \O in TeX ** consciousness..."
>
------------------------------------------------------------ -------------------
Red_im='rgn20060' ; image file names
Vis_im='rgn20061'
Blu_im='rgn20062'
rmax=2500 ; max value for R
vadj=1.4 ; mult. factor for V image (fudge)
badj=5 ; mult. factor for B image (fudge)
skyred=200. ; sky value to subtract for R image
;imgread,imgr,hr,Red_im ; Read images
;imgread,imgv,hv,Vis_im
;imgread,imgb,hb,Blu_im
skyr=avg(extrac(imgr,325,260,30,30))-skyred ; calc sky values
skyv=avg(extrac(imgv,325,260,30,30))-skyred/vadj
skyb=avg(extrac(imgb,325,260,30,30))-skyred/badj
; extract the 3 appropriate subimages
imr=bytscl(extrac(imgr,443-256,498-256,512,512)-skyr,0,(rmax -skyr))
imv=bytscl(extrac(imgv,443-256,498-256,512,512)-skyv,0,(rmax -skyr)/vadj)
imb=bytscl(extrac(imgb,443-256,498-256,512,512)-skyb,0,(rmax -skyr)/badj)
im=color_quan(imr,imv,imb,r,g,b) ; convert to "true" color
mkhdr,h,im ; make a header
tvlct,r,g,b ; set color table
tv,im ; display image
end
; imgroam,im,h
; choose "Plain TV"
; write_gif
Eric Deutsch Email: deutsch@astro.washington.edu
Department of Astronomy FM-20 Voice: (206) 543-1979
University of Washington FAX: (206) 685-0403
Seattle, WA 98195 Johnson Hall, Room 226
|