Skip to content

Instantly share code, notes, and snippets.

@countingpine
Created April 25, 2020 13:14
Show Gist options
  • Select an option

  • Save countingpine/53e18dfa70fc7041b4b5e49cc0f99bbf to your computer and use it in GitHub Desktop.

Select an option

Save countingpine/53e18dfa70fc7041b4b5e49cc0f99bbf to your computer and use it in GitHub Desktop.
zopflipng-inplace - run zopflipng (no parameters) on a set of input files, shrinking if possible
#!/bin/bash
for i in "$@";
do
tmpfile=$(mktemp -u --suffix=.png)
zopflipng "$i" "$tmpfile" && mv "$tmpfile" "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment