Skip to content

Instantly share code, notes, and snippets.

@WebFreak001
Created June 25, 2019 13:33
Show Gist options
  • Save WebFreak001/4f8786c9bdf847dab5121316805c3b48 to your computer and use it in GitHub Desktop.
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)
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