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
# jpg | |
brew install jpegoptim | |
find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \; | |
# png | |
brew install optipng | |
find . -name "*.png" -exec optipng -o7 {} \; | |
# webp | |
find . -type f \( -iname \*.jpg -o -iname \*.png \) -print0 | while read -d $'\0' file; do cwebp -q 80 "$file" -o "${file%.*}.webp"; done |