How to convert my photos to webp format of Google in windows 8.1?

After you download cwebp binaries (.exe) from Google you can run it with PowerShell.

Copy and paste the code below in PowerShell and press enter to run it.

Read the comments in the snippet for more information.

# on Windows Explorer, shift + right-click a directory and copy its path
# paste the path in $dir
$dir = "path/to/directory"

# get all files in the directory
$images = Get-ChildItem $dir

# loop through every images
foreach ($img in $images) {
  # output file will be written in the same directory 
  # but with .webp extension instead of old extension
  $outputName = $img.DirectoryName + "\" + $img.BaseName + ".webp"

  # copy-paste the path to cwebp program 
  # and set its input and output parameters
  # more options https://developers.google.com/speed/webp/docs/cwebp
  C:\webp-converter\libwebp-0.6.1-windows-x64\bin\cwebp.exe $img.FullName -o $outputName
}

To convert any image format to webp from Windows command line (CMD)

Download latest webp release from this page

I downloaded this package because my system is a 32 bit windows 10

Extract it and set environmental variable (follow below steps)

Click start button type "view advanced system settings" and open it (this step may differ in win xp or win 7) Click Environment Variables>User Variables>New>Variable Name:path Variable Value:C:\libwebp-1.0.2-windows-x86\bin

Now open CMD > Go to Image folder run following command

cwebp -q 50 -m 6 -af -f 50 -sharpness 0 -mt -v -progress source_img.jpg -o converted.webp