I have a bunch of PNG
files named foo<bar>.png
I wish to convert to TIF animation. <bar>
is a number varies from 0 to 25 in leaps of five. ImageMagick place foo5.png
last in the animation while it is supposed to be second. Is there a way, apart from renaming the file to foo05.png
to place it in the right place?
Simple and easy, list your images and sort them:
convert -delay 10 -loop 0 $(ls -1 *.png | sort -V) animated.gif
Even easier than ls and sort is to use the built-in -v option of ls:
convert -delay 10 -loop 0 `ls -v *.png` animated.gif
with `...`
being executed instead of interpreted as string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With