I wrote this app to my Next.JS static generated app to convert PNG and JPEG files to webp format
This is a Makefile project just type make
and the project will be built and installed to /usr/local/bin
folder.
After install type: towebp
and the app will locate all the png and jpeg files and converts and writes the webp variant next to the original file with same size.