Can someone please explain how to use "pngcrush" to multiply items

I have a stack of hundreds of images and I want to use pngcrush to reduce file sizes.

I know how to crush one file using the terminal, but on the whole Internet I find parts of the explanations that suggest previous knowledge.

can someone explain how to do this clearly.

Thanks Shani

+4
source share
3 answers

You can use the following script:

#!/bin/bash # uncomment following line for more aggressive but longer compression # pngcrush_options=-reduce -brute -l9 find . -name '*.png' -print | while read f; do pngcrush $pngcrush_options -e '.pngcrushed' "$f" mv "$f" "${f/%.pngcrushed/}" done 
+5
source

Current versions of pngcrush support this functionality out of the box.

(I am using pngcrush 1.7.81)

pngcrush -dir outputFolder inputFolder/*.png

will create an "outputFolder" if it does not exist and processes all .png files in an "inputFolder", placing them in an "outputFolder".

Obviously, you can add other parameters, for example.

pngcrush -dir outputFolder -reduce -brute -l9 inputFolder/*.png

0
source

High marks seem dangerous to me; he started compressing all png files in my iMac; need a command limited to the specified directory; I am not a UNIX expert; I canceled new files, .pngcrushed search for all files ending with .pngcrushed and .pngcrushed them.

0
source

All Articles