Created
September 16, 2017 21:46
-
-
Save glabra/605afc2ac19cc36ef40b2dbe25566947 to your computer and use it in GitHub Desktop.
animation cursor file (.ani) to animation gif file (.gif) converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# dependencies: | |
# - imagemagick | |
# - ani2ico (https://bbs.archlinux.org/viewtopic.php?id=151153) | |
set -ue | |
PATH='/usr/bin:/bin' | |
IFS=' | |
' | |
case "${1:-}" in | |
*.ani) ;; | |
*) | |
printf 'provide .ani file as an argument.\n' | |
exit 1 | |
;; | |
esac | |
./ani2ico $1 | |
icos=$(ls -v ${1%%.ani}*.ico) | |
convert -dispose background -layers optimize -loop 0 -delay ${2:-10} $icos out.gif | |
rm -f -- $icos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment