graphic formats [message #15408] |
Fri, 14 May 1999 00:00  |
Steve Carothers
Messages: 5 Registered: March 1999
|
Junior Member |
|
|
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
|
|
|
Re: graphic formats [message #15411 is a reply to message #15408] |
Thu, 13 May 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Steve Carothers (onav1@flash.net) writes:
> Is there a way to output plots in an easily portable format such as gif or
> jpg?
Of course. I recommend you become acquainted with the on-line
help. It is truly helpful. :-)
IDL> ? GIF
IDL> ? JPEG
IDL> ? TIFF
You might also want to try my XWindow program. This
program will allow you to display a wide variety of
IDL graphics commands (including your own if you write
them following a few simple rules) in a resizeable
window. But the best part is that you can automatically
get what you see in the window to print in GIF, JPEG,
TIFF, and PostScript output. You can find the program
on my web page:
http://www.dfanning.com/programs/xwindow.pro
I produce almost all the output you see on my web
page from this program.
XWindow, 'Shade_Surf', Dist(40), /XColors, /Output
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
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.---
|
|
|
Re: graphic formats [message #15463 is a reply to message #15408] |
Tue, 18 May 1999 00:00  |
jmeloy
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
Below is a short code segment that demonstrates
how to use the image_create and image_write
functions
COMMON Colors, r_orig, g_orig, b_orig,r_curr,
g_curr, b_curr
imgsz = 400
imgtype = 'gif' ; use
GIF,JPEG,MIFF,PCD,PCX,PNG,SUN,TGA,TIFF
DEVICE,pseudo_color=8
WINDOW, 0, /Free, Xsize = imgsz, Ysize = imgsz,
colors = 256
LOADCT, 5
cmap = [TRANSPOSE(r_curr), TRANSPOSE(g_curr),
TRANSPOSE(b_curr)]
tvscl, DIST(imgsz)
graphic = TVRD(0, 0, imgsz-1, imgsz-1)
iout = image_create(graphic, Colormap = cmap,
File_type = imgtype)
status = image_write('img.'+imgtype, iout,
/overwrite)
Hope this helps
Jeff
>
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
|
|
|