-
-
Save confluencepoint/8f2ac16508f435b4e58eae5570e2b4fe to your computer and use it in GitHub Desktop.
sips downscale image by percentage in Mac OS X
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 characters
| #!/bin/bash | |
| if [ $1 ] | |
| then | |
| echo Processing file $1; | |
| else | |
| for var in `find *.png`; | |
| do | |
| echo Processing file $var; | |
| sips -Z $(($(sips -g pixelWidth "$var" | cut -s -d ':' -f 2 | cut -c 2-) / 2)) "$var" --out "resized_$var" &> /dev/null | |
| done | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment