Cli Convert Jpg to Webp

Use cwebp from Google.

NOTE: Support Linux, Mac, Windows.

Usage.

cwebp -q 80 image.png -o image.webp

Batch Process in Windows

cwebp doesn't support batch processing, so we need to depend on OS utils.

Run PowerShell.

Paste the following command

$inputDir= "C:\Users\Admin\Dropbox\jpg"$outputDir = "D:\webp"$cwebp = "D:\libwebp-0.4.1-rc1-windows-x64\bin\cwebp.exe"$files = Get-ChildItem $inputDirforeach ($file in $files) {  $outputName = $outputDir + "\" + $file.BaseName + ".webp"  & $cwebp $file.FullName -o $outputName}

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.