Make your website faster by compressing png images in Linux with optipng

by Apr 15, 2020Linux, Software, Wordpress0 comments

Make your website faster by compressing png images in Linux with optipng

Is your  website running slow? Reducing the size of the images will speed it up and you will get higher ranking in Google and other search engines.

In this video, I show you how to speedup your website by compressing png images in CentOS using optipng. 

Commands:

  • Install optipng:

yum install epel-release

yum install optipng

  • To optimize all PNG pictures recursively In sub-folders cd to the parent folder

find -type f -name “*.png” -exec optipng -p {} \;

  • To compress all PNG pictures in one folder: cd to the folder

optipng -p *.png

  • To schedule the command in a cron job, put the path you want right after find:

find /home -type f -name “*.png” -exec optpng -p {} \;

Disclaimer: Use the above instructions at your own risk and always backup your images before performing any of these commands in case something goes wrong.

0 Comments

Submit a Comment

Your email address will not be published.

Follow Us

Pin It on Pinterest

Share This