Last active
October 3, 2023 08:27
-
-
Save jsleetw/9806390 to your computer and use it in GitHub Desktop.
Optimizer image in command line
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
sudo apt-get install jpegoptim optipng | |
find . -type f -name "*.jpg" -exec jpegoptim {} \; | |
find . -type f -name "*.png" -exec optipng {} \; | |
find . -type f -name "*.jpeg" -exec jpegoptim {} \; | |
--- | |
sudo apt-get install imagemagick | |
find . -type f -size +1000k -name "*.jpg" -exec convert {} -resize "2048>x2048>" {} \; | |
find . -type f -size +1000k -name "*.jpeg" -exec convert {} -resize "2048>x2048>" {} \; | |
find . -type f -size +1000k -name "*.png" -exec convert {} -resize "2048>x2048>" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment