Skip to content

Instantly share code, notes, and snippets.

@wilcoverhoeven
Last active February 21, 2016 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilcoverhoeven/15d5cf98c0b34e773e79 to your computer and use it in GitHub Desktop.
Save wilcoverhoeven/15d5cf98c0b34e773e79 to your computer and use it in GitHub Desktop.
OSX bash script to reduce image (jpg) size, by resizing, removing color profiles and saving with a jpg quality of 70%.
#!/bin/bash
find . -type f \( -name '*.jpg' -o -name '*.JPG' -o -name '*.jpeg' -o -name '*.JPEG' \) -print0 | xargs -0 sips $(file) --resampleHeightWidthMax 2000 --deleteProperty profile --setProperty formatOptions 70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment