How to install Image optimization tools?

How to install Image optimization tools?

The tools should be installed on the server using the root user.

For Linux based environment the following command should be run:
  1. sudo apt install jpegoptim
  2. sudo apt install optipng
  3. sudo apt install gifsicle
  4. sudo apt install webp
For Centos:
  1. sudo yum install gifsicle
  2. sudo yum install jpegoptim
  3. sudo yum install optipng
  4. sudo yum install libwebp-tools
  5. sudo yum install libwebp.x86_64
Additionally, you can check Google's guide. In the repository, you'll find the list of available packages.