如何在Windows 8.1中将我的照片转换为Google的webp格式? [英] How to convert my photos to webp format of Google in windows 8.1?

查看:178
本文介绍了如何在Windows 8.1中将我的照片转换为Google的webp格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将照片从jpg,gif和png转换为 WebP 格式!
当我尝试使用CMD使用cwebp命令时,我收到以下错误消息:

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'不被识别为内部或外部命令,可操作
程序或批处理文件。

'cwebp' is not recognized as an internal or external command, operable program or batch file.

我已经下载了所有需要的文件,例如libwebp-0.4.0-windows-x86.zip和WebpCodecSetup.exe(来自这个网址: https://code.google.com/p/webp/downloads/list )。

I've downloaded all the files needed such as libwebp-0.4.0-windows-x86.zip and WebpCodecSetup.exe (from this url : "https://code.google.com/p/webp/downloads/list").

即使我已经安装了Visual Studio来使用它的命令提示符,但是没有工作!!!

even I've installed Visual Studio to use its command prompt, but didn't work !!!

有没有人可以提供帮助我是

Is there anyone can help me ??

是否有人知道任何减少图像尺寸而不会降低图像质量的工具?

Is anyone know any tool to reduce image size without lossing its quality ?

推荐答案

下载 cwebp 二进制文件(.exe您可以使用PowerShell运行它。

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

将以下代码复制并粘贴到PowerShell中,然后按Enter运行它。

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
}

这篇关于如何在Windows 8.1中将我的照片转换为Google的webp格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆