Skip to content
TrySitePrice

Linux / Unix Command To Optimize and Compress PNG Files In Bulk

Best/Tutorial

One way to optimize and compress PNG files in bulk is by using the optipng command line tool. Here's an example of how to use it:

$ for file in *.png; do optipng -o7 "$file"; done

This will optimize all PNG files in the current directory using level 7 optimization. The resulting files will be smaller in size while retaining the original quality.