-
-
Save joshua-chavanne/1f43f37b9654343e851f23d46b254cf4 to your computer and use it in GitHub Desktop.
Revisions
-
rkbhochalya created this gist
May 16, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ # Recursively optimize PNG and JPEG images using convert command # # `convert` is part of ImageMagick (http://www.imagemagick.org/). You will need to install it first. # # Author: Rajendra Kumar Bhochalya (http://rkb.io) # # @see https://developers.google.com/speed/docs/insights/OptimizeImages # Optimize all JPEG images in current directory and subdirectories find . -name "*.jpg" -exec convert "{}" -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB "{}" \; -exec echo "{}" \; # Optimize all PNG images in current directory and subdirectories find . -name "*.png" -exec convert "{}" -strip "{}" \; -exec echo "{}" \;