Skip to content

Instantly share code, notes, and snippets.

@uxder
Created September 30, 2016 08:03
Show Gist options
  • Save uxder/04de77e04557c53eaea46adc396bb1bd to your computer and use it in GitHub Desktop.
Save uxder/04de77e04557c53eaea46adc396bb1bd to your computer and use it in GitHub Desktop.
alpha-transparency-gif-maker.sh
## A script to make a series of pngs that uses alpha transparency into an animated gif.
## Gifs only support 100% transparent or a 100% opaque pixel colors so imagemagick will convert your 80% transparent color into 100%.
## Requires: Imagemagick
# Make all transparency into white pixels.
mogrify -background white -alpha remove *.png
# Convert the white pixels back to transparency.
for f in *.png
do
echo "Processing for - $f"
# convert $f -white-threshold 90% -transparent white $f
convert $f -transparent white $f
done
convert -alpha set -delay 1.5 -dispose 2 -loop 0 *.png animated.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment