writing color images - revisited [message #8038] |
Thu, 30 January 1997 00:00  |
gennari
Messages: 25 Registered: April 1994
|
Junior Member |
|
|
Hi all,
I'm trying to combine 3 grayscale satellite images to create
a false color composite using the following code
read_gif,'ir2.gif',ir2,r,g,b
read_gif,'ir4.gif',ir4,r,g,b
read_gif,'ir5.gif',ir5,r,g,b
window,0,xsize=570,ysize=460
tv,ir2
red = tvrd(0,0,570,460,channel=1)
tv,ir4
green = tvrd(0,0,570,460,channel=2)
tv,ir5
blue = tvrd(0,0,570,460,channel=3)
;b=tvrd()
tv,red,channel=3
tv,green,channel=2
tv,blue,channel=1
test = tvrd()
write_gif,'spam.gif',test,r,g,b
This will display the colorized GIF to the screen but when I write
it to a gif file it comes out grayscale.
What am i missing here?
Thanks,
Scott
____________________________________________________________ __
University of Hawaii voice (808) 956 5392
Dept. of Information & Computer Sciences fax (808) 956 9399
2565 The Mall, Keller 304A
Honolulu, HI 96822 email gennari@Hawaii.Edu
|
|
|
Re: writing color images - revisited [message #8090 is a reply to message #8038] |
Mon, 03 February 1997 00:00  |
pit
Messages: 92 Registered: January 1996
|
Member |
|
|
In article <5cr0ts$cv@news.hawaii.edu>,
gennari@universe.Hawaii.edu (Scott Gennari) writes:
> Hi all,
>
> I'm trying to combine 3 grayscale satellite images to create
> a false color composite using the following code
>
> read_gif,'ir2.gif',ir2,r,g,b
> read_gif,'ir4.gif',ir4,r,g,b
> read_gif,'ir5.gif',ir5,r,g,b
> window,0,xsize=570,ysize=460
> tv,ir2
> red = tvrd(0,0,570,460,channel=1)
> tv,ir4
> green = tvrd(0,0,570,460,channel=2)
> tv,ir5
> blue = tvrd(0,0,570,460,channel=3)
You might skip those tvrd() calls: Use
red=r(ir2)
or - if you want to reduce the image to the number of colors
in the actual map -
red=bytscl(r(ir2), top=!d.n_colors)
> ;b=tvrd()
> tv,red,channel=3
> tv,green,channel=2
> tv,blue,channel=1
> test = tvrd()
> write_gif,'spam.gif',test,r,g,b
> This will display the colorized GIF to the screen but when I write
> it to a gif file it comes out grayscale.
>
> What am i missing here?
Not shure, but maybe to use the correct r,g,b values?
You seem to use a true-color display (otherwise channel won't work).
So you have a true-colored image which you have to convert to
indexed-color. This is done by the color_quan routine:
pic=color_quan(red,green,blue,r,g,b)
write_gif,'spam.gif',pic,r,g,b
Or - as already pointed out by J. Gurman - use the true-color
JPEG-format.
> Thanks,
> Scott
De Nada,
Peter
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Peter "Pit" Suetterlin http://www.uni-sw.gwdg.de/~pit
Universitaets-Sternwarte Goettingen
Tel.: +49 551 39-5048 pit@uni-sw.gwdg.de
-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
Sternfreunde Breisgau e.V. Tel.: +49 7641 3492
____________________________________________________________ ______________
|
|
|