How to add a zoom effect on a GIF or PNG file (command line)

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
pigeon33
Posts: 9
Joined: 2015-11-15T00:15:37-07:00
Authentication code: 1151

How to add a zoom effect on a GIF or PNG file (command line)

Post by pigeon33 »

Hello,

Do you know if it is possible to add a zoom effect on a non animated GIF or PNG file?

This is what I need: http://freegifmaker.me/img/gifim300x226/1249416126.gif

Moreover is it possible to add a delay between each zoom?

(non animated GIF or PNG >> wait X seconds >> zoom effect >>)

Thank you in advance for helping me...

M.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to add a zoom effect on a GIF or PNG file (command line)

Post by snibgo »

That is a GIF file, so can contain multiple frames. PNG files contain only single frames, so can't record animations.

For a zoom effect from a single image:
1. Read the image.
2. Create multiple versions of that image, each scaled by a different amount (but the same overall size).
3. Write the multiple frames to any file format that can record multiple frames, such as GIF.

For step 2, I generally use "-distort SRT".

EDIT: For some examples, see my "Animation with SRT" page.
snibgo's IM pages: im.snibgo.com
pigeon33
Posts: 9
Joined: 2015-11-15T00:15:37-07:00
Authentication code: 1151

Re: How to add a zoom effect on a GIF or PNG file (command line)

Post by pigeon33 »

Hi Snibgo,

Thank you very much for your help!

M.
Post Reply