Re: graphic formats [message #15462 is a reply to message #15408] |
Tue, 18 May 1999 00:00   |
Jeff Meloy
Messages: 1 Registered: May 1999
|
Junior Member |
|
|
In article <hXM_2.974$Qy3.452@news.flash.net>,
"Steve Carothers" <onav1@flash.net> wrote:
> Is there a way to output plots in an easily portable format such as
gif or
> jpg? Currently, I can only output plots using the set_plot command,
which
> gives output "formats" of postscript, Hewlett Packard graphic
language, and
> others that aren't easily portable. The next best thing would be to
find a
> cheap UNIX or PC program that can convert postscript to gif without
losing
> resolution. Any help would be much appreciated.
>
> Steve
>
Here's a quick example showing how to use the image_create and
image_write functions to do what you need.
COMMON Colors, r_orig, g_orig, b_orig, $
r_curr, g_curr, b_curr
;Image types supported
;BMP,GIF,JPEG,MIFF,PCD,PCX,PNG,SUN,TGA,TIFF
imgtyp = 'gif'
imgsz = 400
;display image
DEVICE, pseudo_color = 8
WINDOW, 0, colors = 256, xsize=imgsz, ysize=imgsz
LOADCT, 5
TV,DIST(imgsz)
;write output
graphic = TVRD(0, 0, imgsz-1, imgsz-1)
cmap = [TRANSPOSE(r_curr), TRANSPOSE(g_curr), TRANSPOSE(b_curr)]
iout = IMAGE_CREATE(graphic, Colormap = cmap, File_type = imgtyp)
status = IMAGE_WRITE('test.'+imgtyp, iout, /overwrite)
--
Jeff Meloy
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
|
|
|