converting a gif file to a postscipt file [message #7429] |
Tue, 12 November 1996 00:00  |
Tim Duman
Messages: 2 Registered: June 1996
|
Junior Member |
|
|
I am trying to read in a gif file and write it out to a postscript file.
The reason being is that your color printer only prints postscript.
The program I am using is at the end of the posting. The problems is
when I right it out to the postscript file there is no color in the
file. Can anybody help with this problem
Thank,
Tim Duman
pro giftops, FILENAME=filename
;
; This program converts a gif image file to a postscript file.
;
; Created: Tim Duman, 11/12/96, University of Kansas
;
;
IF NOT KEYWORD_SET(filename) THEN READ,'Input name of file: ',filename
READ_GIF, filename, image, red, green, blue
SET_PLOT,'z'
TVLCT, red, green, blue
TV,image
newimage = TVRD()
strname = STR_SEP(filename,'.')
SET_PLOT,'ps'
DEVICE,FILENAME=strname(0)+'.ps',/COLOR,BITS=8
TVLCT,red,green,blue
TV,newimage
DEVICE,/CLOSE
END ; End program giftops.pro
|
|
|
Re: converting a gif file to a postscipt file [message #7485 is a reply to message #7429] |
Fri, 15 November 1996 00:00  |
Andy Loughe
Messages: 174 Registered: November 1995
|
Senior Member |
|
|
> pro giftops, FILENAME=filename
>
> IF NOT KEYWORD_SET(filename) THEN READ,'Input name of file: ',filename
>
> READ_GIF, filename, image, red, green, blue
> strname = STR_SEP(filename,'.')
> thisDevice = !D.NAME
> SET_PLOT,'ps'
> DEVICE,FILENAME=strname(0)+'.ps',/COLOR,BITS=8
> TVLCT,red,green,blue
> TV,newimage
> DEVICE,/CLOSE
> SET_PLOT, thisDevice
> END ; End program giftops.pro
A few refinements...
; This may be more generally acceptable (i.e., what if
filename='date.time.gif')
strname = strmid( filename, 0, strpos(filename, '.gif') )
Are you TV'ing image, or newimage?
--
Andrew F. Loughe afl@cdc.noaa.gov
University of Colorado, CIRES http://cdc.noaa.gov/~afl
Campus Box 449 phn:(303)492-0707 fax:(303)497-7013
Boulder, CO 80309-0449 "He who laughs last thinks slowest!"
|
|
|