Created
June 10, 2017 14:26
-
-
Save janus57/57578ff6a774ce9afbfece6f595f9d63 to your computer and use it in GitHub Desktop.
Images optimization
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
apt install jpegoptim pngquant optipng |
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 | |
for JPG in $(find . -iname '*.jpg'); do | |
jpegoptim --strip-all --all-progressive ${JPG} | |
echo | |
echo "Optimized JPG: ${JPG}" | |
echo | |
done | |
for JPEG in $(find . -iname '*.jpeg'); do | |
jpegoptim --strip-all --all-progressive ${JPEG} | |
echo | |
echo "Optimized JPEG: ${JPG}" | |
echo | |
done |
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 | |
for PNG in $(find . -iname '*.png'); do | |
pngquant 256 -v --ext .png --force --speed 1 --quality 70-100 ${PNG} | |
echo | |
echo "Optimized PNG: ${PNG}" | |
echo | |
done | |
optipng -o7 *.png | |
optipng -o7 *.PNG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment