Re: ncgm2gif

From: Kate Hedstrom (kate AT
Date: Thu Jun 23 2005 - 11:27:25 MDT

On Thu, Jun 23, 2005 at 11:17:23AM -0600, James Adler wrote:
> Hi,
> I was wondering if someone could help me out with creating
> gif animations from a ncgm file.
> I created a 241 frame ncgm file using ncl. When I loop
> through the frames it is kind of slow and choppy, so I was
> hoping to convert it to a gif file. I downloaded the
> script ncgm2gif and tried to use that. It seemed to work
> except that I get the following error:
> Converting your NCGM(s) to GIF...
> convert: Not a SUN raster image (KineticEnergy.sun).
> convert: Missing an image file name.
> 241 times.
> It then says that the conversion was successful and even
> creates a gif file. But it happens to be empty.
> I'm not sure if I'm missing some program that the
> conversion needs or if there is another problem.
> Also, if there is a way to make the ncgm animation more
> fluid I would be interested in that as well.
> Thanks for your help,
> James

This is the script I use, crude though it may be. It depends on either
convert (from ImageMagick) or the package containing ppmtogif and a lot
of similar programs, and gifsicle:


/usr/local/bin/med -e 'split $' $1
for foo in *.ncgm
  /usr/local/bin/ctrans -d xwd -res 700x700 $foo > $foo.xwd
# convert $foo.xwd $foo.gif
   xwdtopnm $foo.xwd | ppmtogif > $foo.gif
   rm $foo.xwd
gifsicle --loop -O2 -d 10 *.gif > wow.igif

rm *.ncgm *.gif

I called it mkmovie and it's used in an empty directory as
"mkmovie ../file.ncgm".

ncl-talk mailing list

This archive was generated by hypermail 2b29 : Fri Jun 24 2005 - 10:46:04 MDT