[Thread Prev][Thread Next][Index]

Re: [ferret_users] Fwd: ps file to gif or png or jpg



Dear Xueli,

> I have a question over converting ps file produced by ferret to gif
> or png or jpg format.  When I use convert command to do the
> conversion the picture is cut off. So far I haven't found a way to
> make it. Does anyone know how to fix this?

Ferret's postscript output (from Fprint) is not quite perfect
regarding the boundingbox.  You need to trim the picture properly
before converting to a bitmap image.  Over the years I've tried
several methods, it depends a bit on your system and the ferret
version.   Try one of these and check if the boundingbox is now
properly converted:

1)   use ps2eps to create a proper eps file:

     cat ferret_output.ps | ps2eps -B > ferret_output.eps
     convert ferret_output.eps ferret_output.png

2)   using a large bitmap as intermediate format (requires gs and netpbm):

     gs -dSAFER -dNOPAUSE -r300  -dDEVICEWIDTHPOINTS=864 -dDEVICEHEIGHTPOINTS=864 -sDEVICE=ppmraw -q -sOutputFile=- -f ferret_output.ps -c showpage -c quit | pnmcrop | convert pnm:- PNG:ferret_output.png
     
     convert -scale 35% ferret_output.png ferret_small.png

3)   There are other tools such as eps2eps and psfixbb.  I don't use those
     anymore but they may work for you.

4)   your problem could be in the rotate command.  Does the cropping
     also happen if you don't rotate?  If that fixes it, do the rotate
     in a separate step based on the png file.

Kind regards,

     Hein


-- 

Dr. Hein Zelle
Advisor Meteorology & Oceanography

Tel:    +31 (0)527-242299
Fax:    +31 (0)527-242016
Email:  hein.zelle@xxxxxxxxxxxxx
Web:    www.bmtargoss.com

BMT ARGOSS
P.O. Box 61, 8325 ZH Vollenhove
Voorsterweg 28, 8316 PT Marknesse
The Netherlands

----Confidentiality Notice & Disclaimer---- 

The contents of this e-mail and any attachments are intended for the
use of the mail addressee(s) shown. If you are not that person, you
are not allowed to read it, to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you
should please delete it from your system. BMT ARGOSS does not accept
liability for any errors or omissions in the context of this e-mail or
its attachments which arise as a result of internet transmission, nor
accept liability for statements which are those of the author and
clearly not made on behalf of BMT ARGOSS.


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement