Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tinypng api
tinypng() {
for f in *.png
do
cmd="curl -s --user api:YOUR_API_KEY --data-binary @$f https://api.tinypng.com/shrink | sed 's/.*https/https/g' | sed 's/\.png.*/.png/g' | xargs curl -s -o $f"
eval "$cmd";
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.