Well first of all you have to download the cwebp compressor tool according to your machine(Windows|Linux) from here.
Now after extracting the folder in C:\Program Files\
you have to set path to cwebp.exe
, below is my path
Path:: C:\Program Files\libwebp\bin
Open cmd to check if you have done right till now.
cmd> cwebp -version
cmd> python --version
Now it's super easy just run the below command and you have your desired output.
cmd> python cwebp_compressor.py folder-name quality
quality can be between [0-100]