Bắt đầu
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Những người đam mê hình ảnh nên sử dụng một trong nhiều sản phẩm phần mềm
hỗ trợ WebP.
Chúng tôi cung cấp cách triển khai tham chiếu cho trong phân phối bộ mã hoá và giải mã libwebp
các ứng dụng bộ mã hoá và bộ giải mã, cwebp
và dwebp
tương ứng để
giới thiệu các chức năng hiện có của WebP. Có thể tải các tệp này xuống
từ kho lưu trữ tệp tải xuống
hoặc có thể được tạo từ nguồn. Các mục này nằm trong thư mục examples/
.
Bộ mã hoá và giải mã libwebp
bao gồm một API bộ mã hoá và giải mã toàn diện. Năn nỉ
hãy tham khảo tài liệu thích hợp nếu bạn muốn thêm tính năng hỗ trợ cho WebP
ứng dụng hoặc trình duyệt của bạn.
Dùng cwebp
trên dòng lệnh để chuyển đổi tệp hình ảnh PNG hoặc JPEG sang WebP
. Bạn có thể chuyển đổi tệp hình ảnh PNG thành hình ảnh WebP với một phạm vi chất lượng
80 bằng lệnh:
cwebp -q 80 image.png -o image.webp
Hãy tham khảo tài liệu cwebp
để biết nội dung mô tả
của bộ mã hoá, các lựa chọn tiêu chuẩn và nâng cao.
Sử dụng dwebp
trên dòng lệnh để chuyển đổi tệp hình ảnh WebP sang định dạng PNG hoặc PPM
. Bạn có thể chuyển đổi tệp hình ảnh WebP, chẳng hạn như image.webp
thành hình ảnh PNG
bằng lệnh:
dwebp image.webp -o image.png
Hãy tham khảo tài liệu dwebp
để biết nội dung mô tả
của bộ giải mã và tuỳ chọn dòng lệnh của bộ giải mã đó.
Xem hình ảnh gốc của bạn
WebP là định dạng hình ảnh mới và được hỗ trợ vốn trong Google Chrome, Opera,
và nhiều người khác
ứng dụng và thư viện.
API cho Codec WebP
Nhóm WebP đã cung cấp một API mở rộng để giúp nhà phát triển thêm
hỗ trợ các ứng dụng của họ, bao gồm cả trình duyệt, công cụ chỉnh sửa hình ảnh
dưới dạng ứng dụng gốc.
Hãy tham khảo tài liệu API để biết nội dung mô tả về
Giao diện lập trình ứng dụng libwebp
.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-08 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-08 UTC."],[[["\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."]]