分享个自己在用的iphone@2x图片(2倍图片retina)生成1倍大小图的脚本
首先你得装个图片切割的工具,ImageMagick
#!/bin/sh
rm -rf 1x
rm -rf 2x
mkdir 1x
mkdir 2x
#name2x
for img in `ls *@2x.png`
do
name1x=1x/${img%@*}.png
name2x=2x/${img%@*}@2x.png
echo ${name1x}
convert -resize 50%x50% ${img} ${name1x}
echo ${name2x}
cp ${img} ${name2x}
done