Last active
July 5, 2017 07:55
-
-
Save simplesessions/adb41211218125c7a46d02e2f91bba42 to your computer and use it in GitHub Desktop.
Recursively compress JPGs
This file contains 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
# Ref: https://guides.wp-bullet.com/batch-optimize-jpg-lossy-linux-command-line-with-jpeg-recompress/ | |
# Run a quality check against each image, then compress using the best settings | |
brew install mozjpeg | |
find [path/to/images] -type f -iname '*.jpg' -exec jpeg-recompress --quality medium --min 60 --method smallfry \{} \{} \; | |
# Remove metadata from images | |
brew install exiftool | |
find [path/to/images] -type f -iname "*.jpg" -exec exiftool -overwrite_original -all= \{} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment