Last active
June 2, 2016 15:44
-
-
Save D3f0/2392c3810fd1879a4b244d70580aba8a to your computer and use it in GitHub Desktop.
Convertir GIF a archivos PNG comprimidos (para mayor desempeño de KIVY)
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/bash | |
# Uso: gif2pngzip.sh ARCHIVO.GIF [ARCHIVO2.GIF] | |
if ! which convert 1>/dev/null 2>/dev/null; then | |
echo "Falta instalar imagemagick" | |
exit 1 | |
fi | |
for archivo in $@; do | |
if [ ! -f $archivo ]; then | |
echo "$archivo no es un archivo!" | |
fi | |
temporal=$(mktemp -d) | |
echo "Guardando cuadros temporalmente en $temporal" | |
convert $archivo $temporal/frame.png | |
count=$(ls $temporal/*.png | wc -l) | |
filename=$(basename "$archivo") | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
target="$filename.zip" | |
zip -j $target $temporal/*.png | |
echo "ZIP $target generado con $count imagenes" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment