Last active
March 5, 2020 08:08
-
-
Save monnoval/b149a7fa1ca603bf9a95d428dbbae98a to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
find . -type f \( -name "*.jpg" -o -name "*.jpeg" \) -print0 | xargs -0 mogrify -density 72 -set colorspace Gray -separate -average -strip -interlace Plane -gaussian-blur 10 -quality 1% | |
find . -name "*.png" -print0 | xargs -0 mogrify -density 72 -colors 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setup
brew install imagemagick
chmod +x reduce-image-file-size.sh
./reduce-image-file-size.sh
Notes
This script does use 100% of your CPU so be aware and careful when running this command