Skip to content

Instantly share code, notes, and snippets.

@yuyalush
Created July 15, 2013 09:39
Show Gist options
  • Save yuyalush/5998685 to your computer and use it in GitHub Desktop.
Save yuyalush/5998685 to your computer and use it in GitHub Desktop.
pngquantを使って同じディレクトリ内のPNGファイルを圧縮します。 元画像はboforeというディレクトリに保存され、圧縮後のファイルはfix.shと同じ位置に保存されます。
pngquant ./*.png
mkdir output
mv ./*-fs8* ./output
cd output
for file in *-fs8*;
do mv $file `echo $file | sed 's/-fs8//'`;
done
cd ..
mkdir before
mv ./*.png before
mv ./output/* ./
rmdir output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment