RE: [ncl-talk] Reducing the file size of PS images. (fwd)

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 3 Apr 2006 22:07:12 -0600 (MDT)

>Does any one have an example of a good way to reduce the file size of post
>script images being created in a loop? I am trying to make yearly
>animations (365 fames) from netcdf files with daily values. Using
the "do" function I can create images as post scripts but the files
>are quite large when combined. I've playing around with the ImageMagick
>functions convert and mogrify but haven't been able to get them working.
>If someone has an example of what they've done, I would appreciate
>being able to look at their ncl >file.


The "Getting Started Using NCL"

has an example using "ncgm" See:


>From within an NCL script ... [Version: ImageMagick 6.2.2]

  pltType = "ps" ; ps, eps,...
  do n=1,365
     pltName = "alex_"+ sprinti("%0.3i", n) ; alex_001, ..., alex_365
     wks = gsn_open_wks(pltType ,pltName) ; ps, eps ...


     pltNameType = pltName+"."+pltType
     system("convert -density 144 -trim +repage "+pltNameType+" "+pltName+".png")
                     ; sample options ^^^^^^^^^ => ImageMagick 6.2.2
     system("/bin/rm "+pltNameType) ; remove large file
  end do

The above should create 365 png files.

good luck

ncl-talk mailing list
Received on Mon Apr 03 2006 - 22:07:12 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 04 2006 - 11:27:39 MDT