Pngcrush is not installed by default in Linux, but it is available in the repositories of most Linux distributions. In Ubuntu Linux, you can install pngcrush by running the following command :
$ sudo apt-get install pngcrush
OpenSuSe user can install Pngcrush using "1-click" installer - here
Running the Pngcrush command with no options may produce smaller files. Here is how we can use it to optimize and reduce size of PNG files -
$ pngcrush -brute -e "Optimize.png" filename.png
-brute – Use brute force, try 114 different filter/compression methods. This option is very time consuming but will able to reduce the size of PNG images by significant factor using this option.
-e "ext" – Specify a new extension for all output files. In the above example, the output of the command will be a file named filename Optimize.png . You can use any extension you want. This option ensures that the original file is not overwritten.
$ pngcrush -brute -d "/home/laf/images/pngcrush/" *.png
All the files in the current directory are optimized and saved in the directory denoted by the -d option.