Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save IlyaZha/54e7d9e0c090e05a37d0b2c3abe0392d to your computer and use it in GitHub Desktop.
Save IlyaZha/54e7d9e0c090e05a37d0b2c3abe0392d to your computer and use it in GitHub Desktop.
Image Optimisation
find ./ -name "*.jpg" -size +600k -printf '%p %s ' //find images bigger than 600Kb
find ./ -name "*.jpg" -size +800k -exec convert -resize 1920x {} {} \; //resize images
find ./ -name "*.jpg" -size -330k -exec jpegoptim --all-progressive --strip-all '{}' \; //progressive optimization
find ./ -name "*.jpg" -size +330k -exec jpegoptim -S 330K --all-progressive --strip-all '{}' \; //max size 330K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment