Skip to content

Instantly share code, notes, and snippets.

@glabra
Created September 16, 2017 21:46
Show Gist options
  • Save glabra/605afc2ac19cc36ef40b2dbe25566947 to your computer and use it in GitHub Desktop.
Save glabra/605afc2ac19cc36ef40b2dbe25566947 to your computer and use it in GitHub Desktop.
animation cursor file (.ani) to animation gif file (.gif) converter
#!/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