Converting JPG/JPEG and PNG to WebP

Converting JPG/JPEG and PNG to WebP

Google have a tool to easily convert images 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

20230409_1001_6432e23144568.webp

3) Extract the file you downloaded and store in a place you can easily navigate to, such as C:\

20230409_1001_6432e23b9c121.webp

4) Open Terminal (PowerShell/CMD) as administrator

20230409_1001_6432ea34abdca.webp

5) Navigate to the bin folder of the extracted files
[snippet]cd "path to bin folder"

#Example
cd c:\libwebp-1.3.0-windows-x64\bin[/snippet]

20230409_1001_6432e3936ad75.webp

Single image convert


1) Perform Initial steps before continuing

2) 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)
[snippet]cwebp.exe -q [quality number] [path to the image you want to convert] -o [path to save the converted image]

#Example
cwebp.exe -q 90 "C:\convert to webp\original\20210407_1001_606d608936d92.png" -o "C:\convert to webp\converted\20210407_1001_606d608936d92.webp"[/snippet]

20230409_1001_6432e677b27ba.webp

3) If you navigate to the converted folder, you'll now find the webp file

20230409_1001_6432e77b98479.webp

4) By changing filename, you can covert more files

Batch convert


1) Perform Initial steps before continuing, but for batch PowerShell is required

2) Now you want to enter below, Shift + Enter allows you to go to new line without executing
[snippet]$dir = "[path to the folder of the images you want to convert]"
$images = Get-ChildItem $dir
foreach ($img in $images) {
$outputName = $img.DirectoryName + "\" + $img.BaseName + ".webp"
.\cwebp.exe $img.FullName -o $outputName
}

#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
}[/snippet]

20230409_1001_6432eb773d977.webp

3) Now the files have been converted to WebP

20230409_1001_6432ebae764c8.webp



Tags: #WebP #PNG #JPG #JPEG #ConvertJPGtoWebP

We sometimes publish affiliate links and these always needs to follow our editorial policy, for more information check out our affiliate link policy

You might also like

Comments

Sign up or Login to post a comment

There are no comments, be the first to comment.