Resize GIF and keep only the first frame

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ViPeR_930
Posts: 6
Joined: 2015-09-18T13:31:52-07:00
Authentication code: 1151

Resize GIF and keep only the first frame

Post by ViPeR_930 »

Hi,
I need to batch resize a lot of animated GIFs and remove the animation. I would like to keep only the first frame. What can I add to mogrify to remove the animation this way?

Thank you
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resize GIF and keep only the first frame

Post by fmw42 »

I do not know if this will work or not, but try

Code: Select all

mogrify .... *[0]
or if you have a specific suffix

Code: Select all

mogrify .... *.suffix[0]
or

Code: Select all

mogrify .... -delete [1--1] *.suffix
see http://www.imagemagick.org/Usage/basics/#delete
ViPeR_930
Posts: 6
Joined: 2015-09-18T13:31:52-07:00
Authentication code: 1151

Re: Resize GIF and keep only the first frame

Post by ViPeR_930 »

Thanks. Adding *.gif[0] worked.
Post Reply