Animated GIF with zoom effect

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
soyxan
Posts: 6
Joined: 2017-04-29T07:47:20-07:00
Authentication code: 1151

Animated GIF with zoom effect

Post by soyxan »

I am planning to do a simple zoom effect with a picture and save it as an animated GIF.

This is my command:

Code: Select all

magick rose: -duplicate 100 -resize %[fx:10+t]% -set delay 15 -loop 0 rose.gif
But I get a gif with no animation, just showing the first frame (resize 10%).

The strange thing is that if I run the following command, I get 100 JPG with the zoom effect:

Code: Select all

magick rose: -duplicate 100 -resize %[fx:10+t]% rose.jpg
I am using ImageMagick-7.0.5-Q16 on Windows.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Animated GIF with zoom effect

Post by snibgo »

soyxan wrote:But I get a gif with no animation, just showing the first frame (resize 10%).
Are you sure? For me, the result has animation. But most GIF viewers will crop all frames to the size of the first frame, which is 7x5 pixels. You want all the frames the same size.

There are many ways to do this. For animations, I prefer "-distort SRT".

Code: Select all

magick rose: -duplicate 100 -virtual-pixel None -distort SRT %[fx:(10+t)/100],0 -set delay 15 -loop 0 rose.gif
snibgo's IM pages: im.snibgo.com
soyxan
Posts: 6
Joined: 2017-04-29T07:47:20-07:00
Authentication code: 1151

Re: Animated GIF with zoom effect

Post by soyxan »

Maybe the problem was Internet Explorer as a viewer. In any case your suggestion (SRT) worked like a charm!
Thanks a lot!
Post Reply