#!/bin/bash
# author : jiangxf 2015.1.21
if [ $#-lt 2]; then
echo"Usage: resizePng.sh {pngName} {percentage}";
exit;
fi
width=`sips -g pixelHeight $1| tail -n1| awk -F: ‘{print $2}‘`
newWidth=`expr $width \* $2 /100`;
echo "$1: width($width =>$newWidth)";
sips -Z$newWidth $1;
用法
find . -name "*.png" -exec ./resizePng.sh {} 67 \;
原文地址:http://blog.csdn.net/epeaktop/article/details/42966889