Created
April 30, 2018 21:13
-
-
Save vampjaz/c8013f800d43ab6d467368751d596be8 to your computer and use it in GitHub Desktop.
makes still pngs into a still gif (for nitro emote server packing)
This file contains hidden or 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 | |
## all the input files should be png files in the current directory | |
# dependencies: imagemagick convert utility | |
mkdir -p temp | |
mkdir -p output | |
for file in *.png | |
do echo "Converting $file" | |
cp "$file" temp/1.png | |
cp "$file" temp/2.png | |
output="output/$(echo $file | cut -d. -f1).gif" | |
convert temp/*.png "$output" | |
rm -f temp/*.png | |
size=$(du -k "$output" | cut -f1) | |
if [[ $size > 255 ]] | |
then echo "\x1B[31mWarning: $output is too large\x1B[0m" | |
fi | |
done | |
rm -rf temp | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment