Last active
April 5, 2018 16:22
-
-
Save JoelLisenby/0f51dd8e5797e5cfaf53bfcc9e76d605 to your computer and use it in GitHub Desktop.
Optimize all jpg and png images in current directory and sub-directories recursively with imagemagick mogrify to google pagespeed spec.
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
#!/bin/sh | |
find . -name '*.jpg' -execdir mogrify -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB -format jpg {} \; | |
find . -name '*.png' -execdir mogrify -strip {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment