rotate_emoji.sh
: 透過rotate_emoji1.sh
: 背景白
Created
February 3, 2020 02:12
-
-
Save sapphi-red/262b2fea5fa0b537f5e1a5cea0ed4229 to your computer and use it in GitHub Desktop.
rotate emoji
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/bash | |
WORKDIR=`mktemp -d "tmp-image.XXXXXX"` | |
input=$1 | |
output=$2 | |
convert ${input} ${WORKDIR}/input.png | |
for i in `seq -f %02g 0 50`; do | |
deg=`echo "scale=1; $i * 7.2" | bc` | |
convert -background none -rotate ${deg} ${WORKDIR}/input.png ${WORKDIR}/img-${i}.png | |
done | |
convert -layers Optimize -loop 0 -delay 2 -dispose previous ${WORKDIR}/img-*.png ${output} | |
rm -rf ${WORKDIR} |
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/bash | |
WORKDIR=`mktemp -d "tmp-image.XXXXXX"` | |
input=$1 | |
output=$2 | |
convert ${input} -background white -alpha deactivate -flatten ${WORKDIR}/input.png | |
for i in `seq -f %02g 0 50`; do | |
deg=`echo "scale=1; $i * 7.2" | bc` | |
convert -background white -rotate ${deg} ${WORKDIR}/input.png ${WORKDIR}/img-${i}.png | |
done | |
convert -layers Optimize -loop 0 -delay 2 -dispose background -background white ${WORKDIR}/img-*.png ${output} | |
rm -rf ${WORKDIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment