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

Home » Public Forums » archive » Re: Generating PS files and png files at the same time
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
Re: Generating PS files and png files at the same time [message #33272] Tue, 17 December 2002 12:27 Go to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Mirko Vukovic" <mvukovic@taz.telusa.com> wrote in message
news:d96c8f7c.0212171010.4d95b8be@posting.google.com...
> bbox=`cat $< | tr '\015' ' ' | head -100 | egrep "^%%BoundingBox" |
> head -1 | sed -e 's/%%BoundingBox://g''` ;\
> width=`echo $$bbox | awk '{printf("%i\n",$$3)}'` ;\
> height=`echo $$bbox | awk '{printf("%i\n",$$4)}'` ;\
> $(GS) -sDEVICE=png256 -r300 -dBATCH -dNOPAUSE -q
> -dDEVICEWIDTHPOINTS=$$width -dDEVICEHEIGHTPOINTS=$$height
> -sOutputFile=$@ $<

Whoa! You've been in the sun too long!

Let's just say that if God meant us to use all that $$ \ | stuff, he
wouldn't have invented FORMAT='(F10.1)'.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Generating PS files and png files at the same time [message #33275 is a reply to message #33272] Tue, 17 December 2002 10:10 Go to previous messageGo to next message
mvukovic is currently offline  mvukovic
Messages: 63
Registered: July 1998
Member
"Isa Usman" <eepisu@bath.ac.uk> wrote in message news:<atmvsu$oeq@newton.cc.rl.ac.uk>...
> Hello,
>
> Is there a way to generate png files without calling the device procedure
> every time? It's just that every time I plot something I would like a
> postscript and a png copy.
>
> Thanks in advance.
>
> Isa

I use ghostscript for that. you can find it using google. You can
run it from the command line, or equivalently, spawn a shell command.

A simple version for windows would be:
gswin32c -sDEVICE=png256 -r300 -dBATCH -dNOPAUSE -q
-sOutputFile=output.png input.eps

And this is a snippet from my makefile for making png's from eps's (I
use Cygwin for a bash shell in windows, and good chunks of this code
are due to stuff I found on the web)
bbox=`cat $< | tr '\015' ' ' | head -100 | egrep "^%%BoundingBox" |
head -1 | sed -e 's/%%BoundingBox://g''` ;\
width=`echo $$bbox | awk '{printf("%i\n",$$3)}'` ;\
height=`echo $$bbox | awk '{printf("%i\n",$$4)}'` ;\
$(GS) -sDEVICE=png256 -r300 -dBATCH -dNOPAUSE -q
-dDEVICEWIDTHPOINTS=$$width -dDEVICEHEIGHTPOINTS=$$height
-sOutputFile=$@ $<

Hope this helps,

Mirko
Re: Generating PS files and png files at the same time [message #33282 is a reply to message #33275] Tue, 17 December 2002 05:33 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Isa Usman (eepisu@bath.ac.uk) writes:

> Is there a way to generate png files without calling the device procedure
> every time? It's just that every time I plot something I would like a
> postscript and a png copy.

This doesn't seem all that environmentally friendly to
me, but if you *really* need it, you can draw all your
plots in FSC_Window, rather than in normal windows.
Then you can output to JPEG, PNG, TIFF, BMP, PICT and
PostScript files with a push of a button.

IDL> fsc_window, 'plot', findgen(11)

Find the required files here:

http://www.dfanning.com/programs/fsc_window.zip

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Generating PS files and png files at the same time [message #33337 is a reply to message #33272] Wed, 18 December 2002 13:15 Go to previous message
mvukovic is currently offline  mvukovic
Messages: 63
Registered: July 1998
Member
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:<ato3h8$at4$2@newsreader.mailgate.org>...
> "Mirko Vukovic" <mvukovic@taz.telusa.com> wrote in message
> news:d96c8f7c.0212171010.4d95b8be@posting.google.com...
>> bbox=`cat $< | tr '\015' ' ' | head -100 | egrep "^%%BoundingBox" |
>> head -1 | sed -e 's/%%BoundingBox://g''` ;\
>> width=`echo $$bbox | awk '{printf("%i\n",$$3)}'` ;\
>> height=`echo $$bbox | awk '{printf("%i\n",$$4)}'` ;\
>> $(GS) -sDEVICE=png256 -r300 -dBATCH -dNOPAUSE -q
>> -dDEVICEWIDTHPOINTS=$$width -dDEVICEHEIGHTPOINTS=$$height
>> -sOutputFile=$@ $<
>
> Whoa! You've been in the sun too long!
>

Nope, just in my cube :-). But you really should not look too harshly
at the code above. It is only programming, just of a different
flavor.

Mirko
Re: Generating PS files and png files at the same time [message #33356 is a reply to message #33272] Wed, 18 December 2002 03:22 Go to previous message
David Burridge is currently offline  David Burridge
Messages: 33
Registered: January 1998
Member
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message
news:ato3h8$at4$2@newsreader.mailgate.org...
> "Mirko Vukovic" <mvukovic@taz.telusa.com> wrote in message
> news:d96c8f7c.0212171010.4d95b8be@posting.google.com...
>> bbox=`cat $< | tr '\015' ' ' | head -100 | egrep "^%%BoundingBox" |
>> head -1 | sed -e 's/%%BoundingBox://g''` ;\
>> width=`echo $$bbox | awk '{printf("%i\n",$$3)}'` ;\
>> height=`echo $$bbox | awk '{printf("%i\n",$$4)}'` ;\
>> $(GS) -sDEVICE=png256 -r300 -dBATCH -dNOPAUSE -q
>> -dDEVICEWIDTHPOINTS=$$width -dDEVICEHEIGHTPOINTS=$$height
>> -sOutputFile=$@ $<
>
> Whoa! You've been in the sun too long!
>
> Let's just say that if God meant us to use all that $$ \ | stuff, he
> wouldn't have invented FORMAT='(F10.1)'.

Assuming God invented Fortran of course? (and we *don't* want to go
there!!!!) !-)

Dave

--
David Burridge
Burridge Computing, 18 The Green South
Warborough, Oxon, OX10 7DN
England
Tel: +44 (0) 1865 858279, Email: davidb@burridgecomputing.co.uk



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.404 / Virus Database: 228 - Release Date: 15/10/2002
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Windows Question Related to IDL
Next Topic: IDLDE refresh in Windows XP (IDL 5.2.1)

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

Current Time: Wed Oct 08 15:16:02 PDT 2025

Total time taken to generate the page: 0.05665 seconds