Skip to content

Instantly share code, notes, and snippets.

@fullpipe
Last active November 27, 2015 09:24
Show Gist options
  • Select an option

  • Save fullpipe/c24aef4e7382a81f0750 to your computer and use it in GitHub Desktop.

Select an option

Save fullpipe/c24aef4e7382a81f0750 to your computer and use it in GitHub Desktop.

From Kornel stackoverflow answer

If you have limited depth of directories and not too many files, then lazy solution: pngquant *.png */*.png */*/*.png

A standard solution: find . -name '*.png' -exec pngquant --ext .png --force 256 {} \;

and multi-core version: find . -name '*.png' -print0 | xargs -0 -P8 -L1 pngquant --ext .png --force 256 where -P8 defines number of CPUs, and -L1 defines a number of images to process in one pngquant call (I use -L4 for folders with a lot of small images to save on process start).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment