Last active
February 3, 2017 03:55
-
-
Save zbeekman/7482ccd0e87f495387951bd612dc390e to your computer and use it in GitHub Desktop.
Use `git filter-branch` to crush all `.png` files in `<path/to/img/dir/here>` on OS X with imageoptim, imageoptim-cli, and ImageAlpha.app
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
git filter-branch --prune-empty --tree-filter 'pwd ; ls -a ; imageoptim -a -q --verbose -d <path/to/img/dir/here> || true' -- --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also crush jpegs with jpegmini, however I actually didn't have any
jpg
s to crush and accidentally threw the --jpeg-mini flag, and a lot of errors were produced.... presumablyimageoptim-cli
will correct paths tojpg
s correctly if they are present, but YMMV.