I want to convert my photos from jpg, gif, and png to WebP format.
When I'm trying to use CMD for using cwebp command, I got this error message :
'cwebp'
is not recognized as an internal or external command, operable program or batch file.
I've downloaded all the files needed such as libwebp-0.4.0-windows-x86.zip
and WebpCodecSetup.exe
.
Even I've installed Visual Studio to use its command prompt, but didn't work! Is there anyone who can help me?
Is anyone know any tool to reduce image size without losing its quality?
Create or edit an image using Photoshop, then click Save As. Save the file as a WebP using the Format menu. Choose the name and location for your new WebP file and click Save. A settings panel will appear, giving you the option to edit your file further.
Right click on an image file or a folder containing a number of images files, and then click Convert to WebP.
Download cwebp binaries (.exe) and run it with PowerShell:
# tip: on windows explorer shift + right-click a directory and copy its path
$dir = "path/to/photos/directory"
# get all files in the directory
$images = Get-ChildItem $dir
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"
C:\webp-converter\libwebp-0.6.1-windows-x64\bin\cwebp.exe $img.FullName -o $outputName
}
See also cwebp options.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With