Created
June 12, 2019 19:46
-
-
Save OrderAndCh4oS/31c44b4df2acf5c17e08b1c4f9dbfe6f to your computer and use it in GitHub Desktop.
Convert png to gif with ImageMagick
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
| function pngToGif() { | |
| while getopts ":i:o:" opt; do | |
| case $opt in | |
| i) input_file="${OPTARG}" | |
| ;; | |
| o) output_file="${OPTARG}" | |
| ;; | |
| \?) echo "Invalid option -${OPTARG}" >&2 | |
| ;; | |
| esac | |
| done | |
| convert -loop 0 "./${input_file}*.png" "./${output_file}.gif" | |
| rm -- *.png | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment