Forked from julianxhokaxhiu/pagespeed_optimize_images.sh
Created
October 9, 2018 12:14
-
-
Save wayfar9r/b9038a2a5b1d6f79a8e28b0ab2a4ef04 to your computer and use it in GitHub Desktop.
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
This file contains hidden or 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
| #!/bin/bash | |
| find . -type f -name "*.png" -o -name "*.PNG" | xargs optipng -nb -nc | |
| find . -type f -name "*.png" -o -name "*.PNG" | xargs advpng -z4 | |
| find . -type f -name "*.png" -o -name "*.PNG" | xargs pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow | |
| find . -type f -name "*.jpg" -o -name "*.JPG" | xargs jpegoptim -f --strip-all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment