LoginSignup
1
1

More than 5 years have passed since last update.

optipngを並列(マルチプロセス)で行う

Last updated at Posted at 2016-05-05
find . -iname '*.png' -print0 | xargs -0 -n 1 -P 4 optipng -o7
  • -P 4 はコア数
  • -o7 はPNG圧縮の最高設定

もしくは nproc を使ってコア数を自動で判別させても良い。

find . -iname '*.png' -print0 | xargs -0 -n 1 -P `nproc` optipng -o7

参考
http://stackoverflow.com/questions/21801085/optimize-images-in-directory-using-multiple-cpu-cores

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1