網頁的圖片格式
WebP 是一種新型圖片格式,能為網路上的圖片提供優異的無損和有損壓縮功能。使用 WebP 時,網站管理員和網頁程式開發人員可以建立更豐富、更豐富的圖片,進而加快網頁速度。
WebP 無失真圖片比 PNG 小 26%。與相等的 SSIM 品質索引中的類似 JPEG 圖片相比,WebP 有損圖片小 25-34%。
無損 WebP 會支援透明度 (也稱為 Alpha 管道),而且只會額外提供 22% 的位元組。如果可接受有損 RGB 壓縮,失真 WebP 也支援透明度,比起 PNG 檔案,通常能提供較小的 3 倍檔案大小。
動畫 WebP 圖片支援有損、無失真和透明度,相較於 GIF 和 APNG,這種圖片能夠縮減檔案大小。
WebP 的運作方式
失真 WebP 壓縮使用預測編碼為圖片編碼,方法與 VP8 影片轉碼器用於壓縮影片中的主要畫面格。預測程式碼會使用鄰近像素區塊的值來預測區塊中的值,然後只對差異進行編碼。
無損 WebP 壓縮會使用已看過的圖片片段,以便準確重新建構新的像素。如果系統找不到有趣的比對項目,也可以使用本機調色盤。
WebP 檔案包含 VP8 或 VP8L 圖片資料,以及以 RIFF 為基礎的容器。獨立的 libwebp
程式庫可做為 WebP 規格的參考實作,可從我們的 Git 存放區或 tarball 取得。
WebP 支援
Google Chrome、Safari、Firefox、Edge、Opera 瀏覽器和其他許多其他工具和軟體程式庫都已原生支援 WebP。開發人員也為多種圖片編輯工具新增支援功能。
WebP 提供輕量編碼和解碼程式庫 libwebp
,以及用於將圖片轉換為 WebP 格式的指令列工具 cwebp
和 dwebp
,以及用於檢視、混合和動畫 WebP 圖片的工具。完整的原始碼可在下載頁面取得。
WebP Converter 下載
下載適用於 Linux、Windows 或 macOS 的預先編譯 cwebp
轉換工具,將喜愛的集合從 PNG 和 JPEG 轉換為 WebP。
請透過專案的郵寄清單,告訴我們您的想法。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-04 (世界標準時間)。
[null,null,["上次更新時間:2024-09-04 (世界標準時間)。"],[[["WebP is a modern image format that offers superior lossless and lossy compression for images on the web, resulting in smaller and richer images."],["WebP lossless images are 26% smaller than PNGs and lossy images are 25-34% smaller than comparable JPEGs at equivalent quality."],["WebP supports transparency in both lossless and lossy modes, providing significant size reductions compared to PNGs."],["Animated WebP images offer reduced file sizes compared to GIFs and APNGs while supporting lossy, lossless, and transparency."],["WebP is natively supported in major web browsers like Chrome, Safari, Firefox, Edge, and Opera, as well as many other tools and software libraries."]]],["WebP, a modern image format, offers superior lossless and lossy compression compared to PNGs and JPEGs. Lossless WebP images are 26% smaller than PNGs, and lossy WebP images are 25-34% smaller than JPEGs. WebP supports transparency, even in lossy formats, and animated WebP images. It employs predictive coding for lossy compression and utilizes existing image fragments for lossless compression. Supported by major browsers and tools, WebP includes the `libwebp` library and `cwebp`/`dwebp` conversion tools.\n"]]