開始使用
透過集合功能整理內容 你可以依據偏好儲存及分類內容。
圖片愛好者應使用 支援 WebP。
我們在 libwebp
轉碼器發布方案中提供參考用的 分別由編碼器和解碼器應用程式,分別設定 cwebp
和 dwebp
展示 WebP 可用的功能可下載這些檔案 從下載存放區 也能從原始碼建構它們位於 examples/
目錄中。
libwebp
轉碼器包含廣泛的編碼器和解碼器 API。請 如要新增對 WebP 的支援,請參閱相關說明文件 您的應用程式或瀏覽器
在指令列中使用 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 是一種新的圖片格式,並由 Google Chrome、Opera、 和其他許多 應用程式和程式庫
WebP 轉碼器適用的 API
WebP 團隊提供廣泛的 API,可讓開發人員在 為自家應用程式提供支援,包括瀏覽器、圖片編輯工具 如同原生應用程式
如需 libwebp
應用程式設計介面。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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,["Image 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\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\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\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\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."]]