Skip to content

Instantly share code, notes, and snippets.

@eshnil2000
Forked from uxder/convert-to-transparent.gif
Created November 29, 2021 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eshnil2000/edd5bbb8fd6cdec08a983505593cd021 to your computer and use it in GitHub Desktop.
Save eshnil2000/edd5bbb8fd6cdec08a983505593cd021 to your computer and use it in GitHub Desktop.
nft-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