开始使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
图片爱好者应该从众多
支持 WebP。
我们在 libwebp
编解码器分发中提供了一个参考实现,
编码器和解码器应用(分别为 cwebp
和 dwebp
)
展示 WebP 的可用功能。这些文件可供下载
从下载内容代码库
也可以基于源代码构建它们位于 examples/
目录中。
libwebp
编解码器包含广泛的编码器和解码器 API。请
如果您想在
您的应用或浏览器
在命令行中使用 cwebp
将 PNG 或 JPEG 图片文件转换为 WebP
格式。您可以将 PNG 图片文件转换为具有质量范围的 WebP 图片
(共 80 个):
cwebp -q 80 image.png -o image.webp
如需了解说明,请参阅 cwebp
文档
及其标准选项和高级选项。
在命令行中使用 dwebp
将 WebP 图片文件转换为 PNG 或 PPM
格式。您可以将 WebP 图片文件(例如 image.webp
)转换为 PNG 图片
命令:
dwebp image.webp -o image.png
如需了解说明,请参阅 dwebp
文档
及其命令行选项。
以原生方式查看图片
WebP 是一种全新的图片格式,
以及许多其他
应用和库
适用于 WebP 编解码器的 API
WebP 团队提供了一个全面的 API,以允许开发者添加
支持其应用,包括浏览器、图片编辑工具以及
和原生应用
请参阅API 文档,了解
libwebp
应用编程接口。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):2025-08-08。"],[[["\u003cp\u003eWebP is a modern image format supported by various software and browsers like Google Chrome and Opera.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elibwebp\u003c/code\u003e codec provides tools like \u003ccode\u003ecwebp\u003c/code\u003e and \u003ccode\u003edwebp\u003c/code\u003e for encoding and decoding WebP images respectively.\u003c/p\u003e\n"],["\u003cp\u003eUsers can leverage command-line tools or the comprehensive API to integrate WebP functionality into their applications.\u003c/p\u003e\n"],["\u003cp\u003eDetailed documentation for the encoder, decoder, and API is available for developers to utilize.\u003c/p\u003e\n"]]],["Image conversion to and from WebP format is facilitated by `cwebp` (encoder) and `dwebp` (decoder) applications, available via download or source build. `cwebp` converts PNG or JPEG to WebP (e.g., `cwebp -q 80 image.png -o image.webp`), while `dwebp` converts WebP to PNG or PPM (e.g., `dwebp image.webp -o image.png`). Developers can integrate WebP support into applications using the provided `libwebp` API. WebP is natively supported by browsers like Chrome and Opera.\n"],null,["# Getting Started\n\nImage enthusiasts should use one of the many software products that\n[support WebP](https://wikipedia.org/wiki/WebP#Support).\n\n*** ** * ** ***\n\nWe provide in the `libwebp` codec distribution a reference implementation for\nthe encoder and decoder applications, `cwebp` and `dwebp` respectively, to\nshowcase the available functionalities of WebP. These files can be downloaded\nfrom the [downloads repository](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html)\nor can be built from source. They reside in the `examples/` directory.\n\nThe `libwebp` codec includes an extensive encoder and decoder API. Please\nconsult the appropriate documentation if you'd like to add support for WebP to\nyour application or browser.\n\nUsing `cwebp` to Convert Images to the WebP Format\n--------------------------------------------------\n\nUse `cwebp` on the command line to convert PNG or JPEG image files to WebP\nformat. You can convert a PNG image file to a WebP image with a quality range\nof 80 with the command: \n\n cwebp -q 80 image.png -o image.webp\n\nConsult the `cwebp` [documentation](/speed/webp/docs/cwebp) for a description\nof the encoder, its standard and advanced options.\n\nUsing `dwebp` to Convert Images from the WebP Format\n----------------------------------------------------\n\nUse `dwebp` on the command line to convert WebP image files to the PNG or PPM\nformat. You can convert a WebP image file, say `image.webp` to a PNG image\nwith the command: \n\n dwebp image.webp -o image.png\n\nConsult the `dwebp` [documentation](/speed/webp/docs/dwebp) for a description\nof the decoder and its command-line options.\n\nViewing your Images Natively\n----------------------------\n\nWebP is a new image format and is natively supported in Google Chrome, Opera,\nand [many other](/speed/webp/faq#which_web_browsers_natively_support_webp)\napplications and libraries.\n\nAPI for the WebP Codec\n----------------------\n\nThe WebP team has provided an extensive API to allow developers to add\nsupport to their applications, including browsers, image editing tools as well\nas native applications.\n\nConsult the [API documentation](/speed/webp/docs/api) for a description of\n`libwebp` application programming interface."]]