Re: Re: eps files

From: Mateus da Silva Teixeira <mtex2k3_at_nyahnyahspammersnyahnyah>
Date: Thu, 05 Apr 2007 10:13:55 -0300

Thanks, Jamie and Fred for the help!

Mateus

Jamie Scott escreveu:
> Mateus,
>
> If you are trying to make png output from ncl, I like to start with a
> regular ps file
> and create a png file using a combination of gs, psselect and
> convert. Someone posted
> this shell script by Rick Taft on ncl-talk a year or two ago. It
> should work on an unix operating
> system that has gs, convert and psselect installed. I've used it on
> mac OSX, solaris and redhat linux OS's.
>
> -Jamie
>
>
> #begin script
> #################################################
> #!/bin/sh
> #
> ##############################################################################
>
> # ps2png Rick Taft
> (06-18-2004)
> #-----------------------------------------------------------------------------
>
> # USAGE: ps2png <file.ps> <page_num> <resolution> [ <max_xsize>
> <max_ysize> ]
> #
> # Creates "file-page_num.png" from the selected page of a PostScript
> file.
> # (1) Selects the single, specified page from a PostScript file
> # (2) Performs PS -> PNG conversion using specified resolution (DPI)
> # (3) Resizes PNG image to (xsize x ysize)
> # where: xsize = max_xsize and ysize <= max_ysize
> # OR
> # xsize <= max_xsize and ysize = max_ysize
> # Resizing is skipped if max_xsize and max_ysize are either not
> specified
> # or either one of them is not positive.
> # (4) Crops the PNG leaving a small white border.
> ##############################################################################
>
>
> if [ $# = 3 ] ; then
> PSFILE=$1
> PAGENUM=$2
> XYRES=$3
> MAXXSZ=0
> MAXYSZ=0
> elif [ $# = 5 ] ; then
> PSFILE=$1
> PAGENUM=$2
> XYRES=$3
> MAXXSZ=$4
> MAXYSZ=$5
> else
> echo 1>&2
> echo 'USAGE: ps2png <file.ps> <page_num> <resolution> [ <max_xsize>
> <max_ysize> ]' 1>&2
> echo 1>&2
> exit 1
> fi
>
> PSTMP="tmp$$.ps"
> PNGTMP="tmp$$.png"
> BNAME=`basename $PSFILE .ps`
> PNGFILE="$BNAME-$PAGENUM.png"
>
> psselect -q $PAGENUM $PSFILE $PSTMP
> gs -q -dBATCH -dNOPROMPT -dNOPAUSE -sDEVICE=png16m -r$XYRES \
> -sOutputFile=$PNGTMP $PSTMP
> if [ "$MAXXSZ" -lt 1 -o "$MAXYSZ" -lt 1 ] ; then
> convert -crop 0x0 -border 5x5 -bordercolor white $PNGTMP $PNGFILE
> else
> convert -crop 0x0 -resize $MAXXSZx$MAXYSZ -border 5x5 -bordercolor
> white $PNGTMP $PNGFILE
> fi
> /bin/rm -f $PSTMP $PNGTMP
>
> #endscript##################################################
>
>
>
> On Apr 4, 2007, at 12:36 AM, ncl-talk-request_at_ucar.edu wrote:
>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Tue, 03 Apr 2007 22:39:14 -0300
>> From: Mateus da Silva Teixeira <mtex2k3_at_yahoo.com.br>
>> Subject: eps files
>> To: ncl-talk_at_ucar.edu
>> Message-ID: <461301C2.9020206_at_yahoo.com.br>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Dear NCL users,
>>
>> The Mini Graphics Manual says that EPS workstation contains a
>> bounding box.
>> However, when I generate an EPS file and try to convert it to PNG, this
>> tool gives an error message:
>>
>> $ eps2png -png -output teste.png boxplotGrupos.eps
>> No bounding box in boxplotGrupos.eps
>> -g must be followed by <width>x<height>
>> Problem creating teste.png for boxplotGrupos.eps
>>
>> And any PNG file is created.
>> Is the Graphics Manual wrong? Or am I doing something wrong?
>>
>> Thanks
>> Mateus
>>
>
> Jamie Scott
> NOAA/ESRL/PSD
> james.d.scott_at_noaa.gov
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 05 2007 - 07:13:55 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 11 2007 - 08:36:47 MDT