Optimize PNG images losslessly with optipng
lossless png compression linux | reduce png file size | run optipng on all images | make screenshots smaller | optipng | png | images | findCaution: This command changes the system. Understand what it does before you run it.
find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f -iname '*.png' -exec optipng -o2 -strip all -preserve {} +Tries various compression parameters and saves each PNG in the smallest variant without changing any pixels. The level ranges from 0 to 7, higher levels save a little more but take considerably longer. -strip all removes metadata, -preserve keeps timestamps and permissions.
Note: Install the optipng package if needed. The files are replaced in place, but the content stays pixel-identical.
Also searched as
- lossless png compression linux
- reduce png file size
- run optipng on all images
- make screenshots smaller