comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » graphic formats
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
graphic formats [message #15408] Fri, 14 May 1999 00:00 Go to next message
Steve Carothers is currently offline  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 Go to previous messageGo to next message
davidf is currently offline  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 Go to previous message
Jeff Meloy is currently offline  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 Go to previous message
jmeloy is currently offline  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.---
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: divide by zero problems
Next Topic: Looking for Hough and/or Radon transform code

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:47:58 PDT 2025

Total time taken to generate the page: 0.00687 seconds