Installing cwebp

sudo apt update sudo apt install webp

Fedora cwebp

sudo dnf install libwebp-tools

Open Suse

sudo zypper install libwebp-tools

Arch u

sudo pacman -S base-devel

git clone https://aur.archlinux.org/libwebp.git

cd libwebp

makepkg -si

Convert JPG and PNG to WEBP

for file in *.jpg *.png; do cwebp "$file" -o "${file%.*}.webp" done