Hello all,
it's been a while since I last did any 'advanced' IM tricks, so I'm a little rusty. I'd like to take an image and make a gif (or any video format with settable speed and looping) with that image, then that same image rotated by 360*1/n, that same image rotated by 360*2/n, ... that same image rotated by 360*(n-1)/n, and then loop the gif. Where n is the number of divisions of the circle.
Any idea ? Thanks
Making a gif by rotating an image
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Making a gif by rotating an image
For example, 36 views at 10 degree intervals:
Code: Select all
convert rose: -duplicate 35 -distort SRT 1,%[fx:t*10] x.gif
snibgo's IM pages: im.snibgo.com
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Making a gif by rotating an image
Please remember to always provide your IM version and which OS or platform you're working on.dargaud wrote: ↑2017-01-16T08:20:35-07:00I'd like to take an image and make a gif (or any video format with settable speed and looping) with that image, then that same image rotated by 360*1/n, that same image rotated by 360*2/n, ... that same image rotated by 360*(n-1)/n, and then loop the gif. Where n is the number of divisions of the circle.
In concept, with any recent version of IM, this should make a 24 frame animated GIF, each frame rotated by 360/24 more than the previous frame.
Code: Select all
convert input.png -duplicate 23 -distort SRT %[fx:t*360/n] -set delay 10 -loop 0 output.gif
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Making a gif by rotating an image
See IM Examples, GIF animations, for an explanation of this technique...
http://www.imagemagick.org/Usage/anim_mods/#distort
For older technique see
Simple Image Warping, Animations
http://www.imagemagick.org/Usage/warping/#animations
http://www.imagemagick.org/Usage/anim_mods/#distort
For older technique see
Simple Image Warping, Animations
http://www.imagemagick.org/Usage/warping/#animations
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Making a gif by rotating an image
Thanks, that's what I was looking for. Although I couldn't get -delay to work in either .gif or .mng output until I saw GeeMack's syntax being "-set delay". In many places of the documentation it's given as -delay (even the man page) and it doesn't work. I'm using version 6.8.9-9 Q16 x86_64 2016-11-29
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Making a gif by rotating an image
Use -delay before reading the input images or use -set delay after reading the input images.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Making a gif by rotating an image
See... GIF Animations Basics....
http://www.imagemagick.org/Usage/anim_basics/#gif_anim
Also see Basics, Setting/Changing Image Attributes/Properities
http://www.imagemagick.org/Usage/basics/#attributes
http://www.imagemagick.org/Usage/anim_basics/#gif_anim
Also see Basics, Setting/Changing Image Attributes/Properities
http://www.imagemagick.org/Usage/basics/#attributes
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/