将png转为webp
Google’s new WEBP image format is pretty cool: its unique compression systems can display images at approximately two thirds the size of the same image rendered in JPEG or PNG format.
Google的新WEBP图像格式非常酷:其独特的压缩系统可显示的图像大小约为以JPEG或PNG格式呈现的同一图像大小的三分之二。
But despite six years of development and being heavily featured in Google products, it still isn’t supported by some of the most common image tools around, like Microsoft’s default Windows photo viewer. Here’s how to save a WEBP image in a more common format.
但是,尽管经过了六年的开发并在Google产品中得到了广泛的应用,但周围的一些最常用的图像工具(例如Microsoft的默认Windows照片查看器)仍然不支持它。 以下是以更常见的格式保存WEBP图像的方法。
Some browsers—Microsoft Internet Explorer and Apple Safari—still don’t support WebP. So, if a website uses .webp files, it has to serve JPEG or PNG versions of those same images to Safari or Internet Explorer. Getting JPEG or PNG versions of the image on a website is often as simple as just opening it in Safari or IE and then downloading the image from that browser.
某些浏览器(Microsoft Internet Explorer和Apple Safari)仍然不支持WebP。 因此,如果网站使用.webp文件,则必须向Safari或Internet Explorer提供这些图像的JPEG或PNG版本。 在网站上获取图像的JPEG或PNG版本通常很简单,只需在Safari或IE中打开它,然后从该浏览器下载图像即可。
From a webpage that contains a WebP image, highlight the URL, right-click it, then click on “Copy.”
在包含WebP图像的网页中,突出显示URL,右键单击它,然后单击“复制”。
Fire up another browser that doesn’t support WebP, right-click the address bar, then click “Paste,” and hit Enter.
启动另一个不支持WebP的浏览器,右键单击地址栏,然后单击“粘贴”,然后按Enter。
If the website does the proper server-side conversion, the page will look the same, but this time all images will be in either JPEG or PNG format.
如果网站进行了正确的服务器端转换,则页面外观将相同,但是这次所有图像都将为JPEG或PNG格式。
Right-click the image, then click “Save Picture As.”
右键单击图像,然后单击“图片另存为”。
Navigate to a destination folder, then click “Save,” and your image will download to that folder.
导航到目标文件夹,然后单击“保存”,您的图像将下载到该文件夹。
That’s it. Navigate to the image and open or edit like you would any other JPEG.
而已。 导航至图像,然后像打开其他JPEG一样打开或编辑。
If you use Windows 10, you can download a WebP image to your hard drive and use MS Paint to open it.
如果使用Windows 10,则可以将WebP图像下载到硬盘驱动器,然后使用MS Paint打开它。
Why not utilize a piece of software already on your PC to convert any images you have? Paint converts WebP into JPEG, GIF, BMP, TIFF, and a few other formats as well, without having to download any extra software.
为什么不利用PC上已有的软件来转换您拥有的图像? Paint可以将WebP转换为JPEG,GIF,BMP,TIFF和其他几种格式,而无需下载任何其他软件。
Right-click on the image, then click Open With > Paint if it’s not set to open WebP files by default.
右键单击图像,然后在默认情况下未将其设置为打开WebP文件的情况下,单击“打开方式”>“绘画”。
Once you open the image in Paint, click File > Save As, then choose a format from the list available.
在“画图”中打开图像后,单击“文件”>“另存为”,然后从可用列表中选择一种格式。
Choose a destination for the file, then click “Save.”
选择文件的目的地,然后单击“保存”。
Once your image is finished converting, it will appear in the folder you saved it.
图像转换完成后,它将显示在您保存的文件夹中。
If you feel more comfortable behind the command line, Google offers up the utilities to encode, decode, and view WebP on Linux, Windows, and Mac OS X. This is a bit of an advanced method that’s great for integrating into programs and website, but if you want to learn how to use a command line tool, feel free to follow along.
如果您对使用命令行感到更满意,则Google会提供实用程序来对Linux , Windows和Mac OS X上的WebP进行编码,解码和查看。 这是一种高级方法,非常适合集成到程序和网站中,但是,如果您想学习如何使用命令行工具,请随时关注。
Depending on your OS, use the appropriate link above to download the libraries, then extract the files to your computer. We’ll be using the Windows Command Prompt, but it should work identically on all systems.
根据您的操作系统,使用上面的适当链接下载库,然后将文件提取到计算机中。 我们将使用Windows命令提示符,但它在所有系统上均应相同。
Open up Command Prompt to the folder with the .webp files to convert. Use the cd
command to change the directory. It should look something like this, replacing “NAME” with your Windows user name:
将命令提示符打开到包含要转换的.webp文件的文件夹。 使用cd
命令更改目录。 看起来应该像这样,用您的Windows用户名替换“ NAME”:
cd C:\users\NAME\Pictures
If you look in the “bin” folder, you may notice a few files with the .exe extension. For this guide, we’ll be using the dwebp.exe
command to decode (convert) a WebP image. The syntax for the command looks something like this:
如果您在“ bin”文件夹中查找,可能会注意到一些扩展名为.exe的文件。 对于本指南,我们将使用dwebp.exe
命令来解码(转换)WebP图像。 该命令的语法如下所示:
C:\Path\To\dwebp.exe inputFile.webp -o outputFile
C:\Path\To\dwebp.exe inputFile.webp -o outputFile
Notice how we didn’t specify the file extension for the output image? That’s because, by default, the decoder converts images into PNG format but can output into TIFF, BMP, and a few other when using other switches. The full documentation can is on the Google WebP website.
请注意,我们如何不为输出图像指定文件扩展名? 这是因为,默认情况下,解码器将图像转换为PNG格式,但在使用其他开关时可以输出为TIFF,BMP等。 完整的文档可以在Google WebP网站上找到。
Although there isn’t an option to convert into JPEG, if you want to convert an image into JPEG, all you have to do is put “.jpeg” at the end of the output file when you use the -o
switch.
尽管没有将其转换为JPEG的选项,但是如果您想将图像转换为JPEG,您要做的就是在使用-o
开关时将“ .jpeg”放在输出文件的末尾。
Pro Tip: If you plan on using this tool often, then you might want to consider adding the encoder, decoder, and viewer executables to your system’s path, for easier access down the road. This makes it so you don’t have to be in the same directory as the executables when you want to run them from the command line from any folder.
专家提示:如果您打算经常使用此工具,则可能需要考虑将编码器,解码器和查看器可执行文件添加到系统路径中,以方便日后使用。 这样一来,当您要从任何文件夹的命令行运行可执行文件时,不必与可执行文件位于同一目录中。
After the tool converts and saves the image, you can navigate to the output file’s location, and open it with any program you want.
工具转换并保存图像后,您可以导航到输出文件的位置,并使用所需的任何程序将其打开。
If you’d instead prefer to use a website to change a WebP image into another format, there are tons of sites offering free online conversion tools to do this. They handle everything server-side, meaning you don’t have to download and install any software or learn command line tools.
如果您宁愿使用网站将WebP图像更改为另一种格式,则有很多站点提供免费的在线转换工具来执行此操作。 它们处理服务器端的所有事情,这意味着您不必下载和安装任何软件或学习命令行工具。
As with any online file conversion tool, you shouldn’t upload any sort of sensitive or confidential file. if you’re concerned someone else might see it—for example, if it’s an image of a confidential document—it’s better to just work with the file on your own computer.
与任何在线文件转换工具一样,您不应上传任何类型的敏感或机密文件。 如果您担心其他人可能会看到它(例如,如果它是机密文档的图像),最好只在您自己的计算机上使用该文件。
For the purpose of this guide, we’ll use Zamzar online file conversion tool. It’s completely free to use and uploaded file delete from the server within 24 hours. If you want to convert more than the five free concurrent conversions, it offers paid subscriptions as well.
就本指南而言,我们将使用Zamzar在线文件转换工具。 它是完全免费的,并且可以在24小时之内从服务器删除上传的文件。 如果您要转换的转换次数超过五次,则它还提供付费订阅。
Head to the Zamzar website, click “Upload,” select the file you want to convert, then click “Open.” Alternatively, just drag and drop the files into the browser tab from your computer.
转到Zamzar网站,单击“上传”,选择要转换的文件,然后单击“打开”。 或者,只需将文件从计算机拖放到浏览器选项卡中。
Next, click “Choose Format, and from the drop-down menu, choose a supported format to convert into.
接下来,点击“选择格式”,然后从下拉菜单中选择一种支持的格式进行转换。
Click “Convert Now.”
点击“立即转换”。
Depending on the size of the file, the conversion should only take a few seconds. After the conversion, you’ll be redirected to the download page, then click the “Download” button to start the download.
根据文件的大小,转换只需几秒钟。 转换后,您将被重定向到下载页面,然后单击“下载”按钮开始下载。
Choose a destination folder for the image, then click “Save.”
选择图像的目标文件夹,然后单击“保存”。
To view the image, head to the folder where you saved it and open it with your favorite image viewer.
要查看图像,请转到保存图像的文件夹,然后使用您喜欢的图像查看器将其打开。
As you might expect, Google uses its WebP images for all products and services on the Google Play Store. In some situations, you can make a slight tweak to the URL of an image to display in another format. While this method doesn’t work on all websites, if you need to quickly force Google Play Store to convert an image for you, this neat little trick could save you some time.
如您所料,Google将其WebP图像用于Google Play商店中的所有产品和服务。 在某些情况下,您可以稍微调整图像的URL以其他格式显示。 尽管此方法并非在所有网站上都适用,但如果您需要快速强制Google Play商店为您转换图片,那么这种巧妙的小技巧可以为您节省一些时间。
Open Chrome, Firefox, Microsoft Edge, or Opera—any browser that supports WEBP image display. Head to a site that uses WEBP images for bandwidth saving, like any of the app listings on play.google.com.
打开Chrome,Firefox,Microsoft Edge或Opera(任何支持WEBP图像显示的浏览器)。 前往使用WEBP图像节省带宽的网站,如play.google.com上的任何应用程序列表。
Right-click or long-press one of the images, and then click the “open image in new tab” option. The WEBP image then gets its own tab all to itself, and the URL at the top of that tab is a link directly to the image asset—without rendering anything else on the page.
右键单击或长按其中一张图像,然后单击“在新选项卡中打开图像”选项。 然后,WEBP图像将获得一个自己的选项卡,该选项卡顶部的URL是直接指向图像资产的链接,而无需在页面上显示任何其他内容。
Click the URL bar, delete the last three characters in the address (the “-rw”), and then press “Enter.” The same image will be displayed again, but this time it’s rendered in its original format, usually JPEG or PNG.
单击URL栏,删除地址中的最后三个字符(“ -rw”),然后按“ Enter”。 相同的图像将再次显示,但是这次以原始格式呈现,通常是JPEG或PNG。
Right-click or long-press the image, and then select the “Save image as” option. That downloads it in the original format—just like any other file.
右键单击或长按图像,然后选择“图像另存为”选项。 它将以原始格式下载它-就像其他任何文件一样。
翻译自: https://www.howtogeek.com/325864/how-to-save-googles-webp-images-as-jpeg-or-png/
将png转为webp