Using PHP GD library to covert common type images to webp format.
Download script:
sudo wget https://gist.githubusercontent.com/johnroyer/85d0631d175b85a7befa3714855f4ab9/raw/3d70527b4c66279eaa97d997f84f1e42a51ccf18/webp.php -O /bin/webp
sudo chmod +x /bin/webp
Usage:
webp image.png NEW_NAME.webp