Created
January 22, 2014 07:01
-
-
Save richard-to/8554587 to your computer and use it in GitHub Desktop.
Simple bash script to apply lossy optimization to jpgs in folder
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 | |
rm -rf out | |
mkdir out | |
for d in $(ls) | |
do | |
if [[ $d == *.jpg ]] | |
then | |
convert $d "out/$d.png" | |
optipng "out/$d.png" | |
convert "out/$d.png" "out/$d" | |
mogrify -quality 60 "out/$d" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment