Converting JPG/JPEG and PNG to WebP
This guide is written for Windows 11, but Google also have tools for other platforms
Initial steps
1) Go to https://developers.google.com/speed/webp/download [↗]2) Click on Download for Windows
3) Extract the file you downloaded and store in a place you can easily navigate to, such as C:\
4) Open Terminal (PowerShell/CMD) as administrator
5) Navigate to the bin folder of the extracted files
#Example cd c:\libwebp-1.3.0-windows-x64\bin
Single image convert
1) Perform Initial steps before continuing2) Converting image, we need to define quality (0 worst - 100 best), path to images and where to save the converted images (can be same as original path)
#Example cwebp.exe -q 90 "C:\convert to webp\original\20210407_1001_606d608936d92.png" -o "C:\convert to webp\converted\20210407_1001_606d608936d92.webp"
3) If you navigate to the converted folder, you'll now find the webp file
4) By changing filename, you can covert more files
Batch convert
1) Perform Initial steps before continuing, but for batch PowerShell is required2) Now you want to enter below, Shift + Enter allows you to go to new line without executing
#Example $dir = "C:\convert to webp\original" $images = Get-ChildItem $dir foreach ($img in $images) { $outputName = $img.DirectoryName + "\" + $img.BaseName + ".webp" .\cwebp.exe $img.FullName -o $outputName }
3) Now the files have been converted to WebP