Created
June 25, 2019 13:33
-
-
Save WebFreak001/4f8786c9bdf847dab5121316805c3b48 to your computer and use it in GitHub Desktop.
Optimizes a whole folder using zopflipng as fish script (just copy paste into the fish shell)
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
for file in *.png | |
echo -n "Optimizing $file..." | |
if zopflipng -y -m $file (basename $file .png)".min.png" | grep "Result is smaller" | |
mv (basename $file .png)".min.png" $file | |
echo " optimized." | |
else | |
rm (basename $file .png)".min.png" | |
echo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment