Skip to content

Instantly share code, notes, and snippets.

@danrcoull
Last active October 25, 2016 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danrcoull/9f9dee782fc63901d8c8633332e8b57b to your computer and use it in GitHub Desktop.
Save danrcoull/9f9dee782fc63901d8c8633332e8b57b to your computer and use it in GitHub Desktop.
bash Compress recursivly all images
#!/bin/bash
cd $1
find . -iname '*.jp*g' -type f -print0 | xargs -0 jpegoptim -o --strip-all --max=80
find . -iname '*.png' -type f -print0 | xargs -0 pngquant --quality=70-80
find . -iname '*.png' -type f -print0 | xargs -0 optipng -o7 strip all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment