gif2webp
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.
Tên
gif2webp
– Chuyển đổi hình ảnh GIF sang WebP
Tóm tắt phim
gif2webp [options] input_file.gif -o output_file.webp
Mô tả
gif2webp
chuyển đổi hình ảnh GIF thành hình ảnh WebP.
Tùy chọn
Các tuỳ chọn cơ bản là:
-o string
- Chỉ định tên của tệp WebP đầu ra. Nếu bạn bỏ qua,
gif2webp
sẽ
thực hiện chuyển đổi mà chỉ báo cáo thống kê.
Sử dụng "-" làm tên đầu ra sẽ chuyển đầu ra tới "stdout".
-- string
- Chỉ định rõ tệp đầu vào. Tuỳ chọn này rất hữu ích nếu dữ liệu đầu vào
tệp bắt đầu bằng "-" chẳng hạn. Lựa chọn này phải xuất hiện cuối cùng.
Sau đó, mọi tuỳ chọn khác sẽ bị bỏ qua. Nếu tệp nhập là "-",
dữ liệu sẽ được đọc từ 'stdin' thay vì một tệp.
-h, -help
- Thông tin sử dụng
-version
- In số phiên bản (dưới dạng main.minor.revision) rồi thoát.
-lossy
- Mã hoá hình ảnh bằng tính năng nén có tổn hao.
-mixed
- Chế độ nén kết hợp: tối ưu hóa khả năng nén hình ảnh bằng cách chọn
nén có tổn hao hoặc không tổn hao đối với mỗi khung hình theo phương pháp phỏng đoán.
-q float
- Chỉ định hệ số nén cho các kênh RGB trong khoảng từ
0
đến 100
. Chiến lược phát hành đĩa đơn
mặc định là 75
. Trong trường hợp nén không tổn hao (mặc định), một hệ số nhỏ
cho phép tốc độ nén nhanh hơn nhưng tạo ra tệp lớn hơn. Cao nhất
nén được thực hiện bằng cách sử dụng giá trị 100
. Trong trường hợp có tổn hao
nén (được chỉ định theo tuỳ chọn tổn hao), một yếu tố nhỏ sẽ tạo ra
tệp nhỏ hơn với chất lượng thấp hơn. đạt được chất lượng tốt nhất bằng cách sử dụng giá trị
trong tổng số 100
.
-min_size
- Mã hoá hình ảnh để có kích thước nhỏ nhất. Thao tác này sẽ vô hiệu hoá tính năng chèn khung chính và
chọn phương thức loại bỏ dẫn đến đầu ra nhỏ nhất cho mỗi khung. Nó
sử dụng tính năng nén không tổn hao theo mặc định, nhưng có thể kết hợp với
-q
, -m
,
Tuỳ chọn -lossy
hoặc -mixed
.
-m int
- Chỉ định phương thức nén sẽ sử dụng. Thông số này kiểm soát giao dịch thương mại
giữa tốc độ mã hoá và kích thước cũng như chất lượng của tệp nén.
Các giá trị có thể nằm trong khoảng từ
0
đến 6
. Giá trị mặc định là 4
. Khi ở mức cao hơn
có sử dụng các giá trị khác nhau, thì bộ mã hoá sẽ mất nhiều thời gian hơn để kiểm tra
các khả năng mã hoá và quyết định mức tăng chất lượng. Giá trị thấp hơn có thể
dẫn đến thời gian xử lý nhanh hơn nhưng đổi lại kích thước tệp lớn hơn và
chất lượng nén thấp hơn.
-kmin int
, -kmax int
Chỉ định khoảng cách tối thiểu và tối đa giữa các khung chính liên tiếp
(các khung có thể tách rời độc lập) trong ảnh động đầu ra. Công cụ này sẽ
chèn một số khung hình chính vào ảnh động đầu ra nếu cần để
tiêu chí được đáp ứng.
Giá trị kmax
0
sẽ tắt tính năng chèn khung chính. Một giá trị kmax
1
sẽ dẫn đến việc tất cả khung hình là các khung hình chính. Giá trị kmin
không
đều được xem xét trong cả hai trường hợp đặc biệt này. Các giá trị điển hình nằm trong
dải ô từ 3
đến 30
. Giá trị mặc định là kmin
= 9
, kmax
= 17
cho
nén không tổn hao và kmin
= 3
, kmax
= 5
đối với nén có tổn hao.
Hai tuỳ chọn này chỉ phù hợp với các hình ảnh động có số lượng lớn
số khung hình (>50).
Khi bạn sử dụng các giá trị thấp hơn, sẽ có nhiều khung hình hơn được chuyển đổi thành khung chính.
Điều này có thể dẫn đến số lượng khung hình cần thiết để giải mã một khung nhỏ hơn
trung bình, do đó cải thiện hiệu suất giải mã. Nhưng điều này có thể dẫn đến
kích thước tệp lớn hơn một chút. Giá trị càng cao thì khả năng giải mã càng kém
giúp tăng hiệu suất, nhưng kích thước tệp nhỏ hơn.
Một số hạn chế:
- kmin < kmax,
- kmin >= kmax / 2 + 1; và
- kmax – kmin <= 30.
Nếu không đáp ứng bất kỳ quy định hạn chế nào trong số này, chúng tôi sẽ thực thi các quy định hạn chế đó
tự động.
-metadata string
Danh sách siêu dữ liệu được phân tách bằng dấu phẩy để sao chép từ dữ liệu đầu vào sang đầu ra nếu
hiện tại. Các giá trị hợp lệ: all
, none
, icc
, xmp
. Giá trị mặc định là xmp
.
-f int
Chỉ dành cho phương thức mã hoá có tổn hao (được chỉ định bởi tuỳ chọn -lossy
). Chỉ định
cường độ của bộ lọc huỷ chặn, giữa 0
(không lọc) và 100
(lọc tối đa). Giá trị 0
sẽ tắt mọi bộ lọc. Cao hơn
sẽ làm tăng cường độ của quá trình lọc được áp dụng sau khi
giải mã hình ảnh. Giá trị càng cao thì ảnh càng mượt
xuất hiện. Các giá trị điển hình thường nằm trong khoảng từ 20
đến 50
.
-mt
Sử dụng phương thức đa luồng để mã hoá (nếu có thể).
-loop_compatibility
Nếu được bật, xử lý thông tin vòng lặp theo cách tương thích cho Chrome
phiên bản trước M62 (bao gồm) và Firefox.
-v
In thêm thông tin.
-quiet
Không in bất kỳ nội dung nào.
Lỗi
Ví dụ
gif2webp picture.gif -o picture.webp
gif2webp -q 70 picture.gif -o picture.webp
gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp
gif2webp -lossy -f 50 picture.gif -o picture.webp
gif2webp -min_size -q 30 -o picture.webp -- ---picture.gif
cat picture.gif | gif2webp -o - -- - > output.webp
Tác giả
gif2webp
là một phần của libwebp
và do nhóm WebP viết.
Cây nguồn mới nhất hiện có tại
https://chromium.googlesource.com/webm/libwebp/
Trang hướng dẫn này được viết bởi Urvang Joshi urvang@google.com, dành cho
Dự án Debian (và có thể được những người khác sử dụng).
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.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-08 UTC."],[[["\u003cp\u003e\u003ccode\u003egif2webp\u003c/code\u003e is a command-line tool used to convert GIF images to the WebP format, potentially offering better compression and quality.\u003c/p\u003e\n"],["\u003cp\u003eUsers can adjust compression parameters like quality (\u003ccode\u003e-q\u003c/code\u003e), lossy/lossless encoding (\u003ccode\u003e-lossy\u003c/code\u003e, \u003ccode\u003e-lossless\u003c/code\u003e), and methods (\u003ccode\u003e-m\u003c/code\u003e) for customized output.\u003c/p\u003e\n"],["\u003cp\u003eAdvanced options allow control over key frames (\u003ccode\u003e-kmin\u003c/code\u003e, \u003ccode\u003e-kmax\u003c/code\u003e), metadata handling (\u003ccode\u003e-metadata\u003c/code\u003e), and deblocking filter (\u003ccode\u003e-f\u003c/code\u003e) for fine-tuning.\u003c/p\u003e\n"],["\u003cp\u003eThe tool supports multi-threading (\u003ccode\u003e-mt\u003c/code\u003e) and offers options for compatibility with older browsers (\u003ccode\u003e-loop_compatibility\u003c/code\u003e) and controlling output verbosity (\u003ccode\u003e-v\u003c/code\u003e, \u003ccode\u003e-quiet\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDetailed usage instructions, including examples and bug reporting information, are provided in the documentation.\u003c/p\u003e\n"]]],["`gif2webp` converts GIF images to WebP format using the command `gif2webp [options] input_file.gif -o output_file.webp`. Key actions include specifying output file names (`-o`), setting compression quality (`-q`), choosing between lossy (`-lossy`) or mixed (`-mixed`) compression, optimizing for minimum size (`-min_size`), adjusting compression methods (`-m`), and setting keyframe intervals (`-kmin`, `-kmax`). Multi-threading (`-mt`) and metadata copying (`-metadata`) are also available. The tool also support standard input and output redirection.\n"],null,["# gif2webp\n\nName\n----\n\n`gif2webp` -- Convert a GIF image to WebP\n\nSynopsis\n--------\n\n`gif2webp [options] input_file.gif -o output_file.webp`\n\nDescription\n-----------\n\n`gif2webp` converts a GIF image to a WebP image.\n\nOptions\n-------\n\nThe basic options are:\n\n`-o string`\n: Specify the name of the output WebP file. If omitted, `gif2webp` will\n perform conversion but only report statistics.\n Using \"-\" as output name will direct output to 'stdout'.\n\n`-- string`\n: Explicitly specify the input file. This option is useful if the input\n file starts with an \"-\" for instance. This option must appear **last**.\n Any other options afterward will be ignored. If the input file is \"-\",\n the data will be read from 'stdin' instead of a file.\n\n`-h, -help`\n: Usage information\n\n`-version`\n: Print the version number (as major.minor.revision) and exit.\n\n`-lossy`\n: Encode the image using lossy compression.\n\n`-mixed`\n: Mixed compression mode: optimize compression of the image by picking\n either lossy or lossless compression for each frame heuristically.\n\n`-q float`\n: Specify the compression factor for RGB channels between `0` and `100`. The\n default is `75`. In case of lossless compression (default), a small factor\n enables faster compression speed, but produces a larger file. Maximum\n compression is achieved by using a value of `100`. In case of lossy\n compression (specified by the -lossy option), a small factor produces a\n smaller file with lower quality. Best quality is achieved by using a value\n of `100`.\n\n`-min_size`\n: Encode image to achieve smallest size. This disables key frame insertion and\n picks the dispose method resulting in the smallest output for each frame. It\n uses lossless compression by default, but can be combined with `-q`, `-m`,\n `-lossy` or `-mixed` options.\n\n`-m int`\n: Specify the compression method to use. This parameter controls the trade\n off between encoding speed and the compressed file size and quality.\n Possible values range from `0` to `6`. Default value is `4`. When higher\n values are used, the encoder will spend more time inspecting additional\n encoding possibilities and decide on the quality gain. Lower value can\n result in faster processing time at the expense of larger file size and\n lower compression quality.\n\n`-kmin int`, `-kmax int`\n\n: Specify the minimum and maximum distance between consecutive key frames\n (independently decodable frames) in the output animation. The tool will\n insert some key frames into the output animation as needed so that this\n criteria is satisfied.\n\n A `kmax` value of `0` will turn off insertion of key frames. A `kmax` value\n of `1` will result in all frames being key frames. `kmin` value is not\n taken into account in both these special cases. Typical values are in the\n range `3` to `30`. Default values are `kmin` = `9`, `kmax` = `17` for\n lossless compression and `kmin` = `3`, `kmax` = `5` for lossy compression.\n\n These two options are relevant only for animated images with large number\n of frames (\\\u003e50).\n\n When lower values are used, more frames will be converted to key frames.\n This may lead to smaller number of frames required to decode a frame on\n average, thereby improving the decoding performance. But this may lead to\n slightly bigger file sizes. Higher values may lead to worse decoding\n performance, but smaller file sizes.\n\n Some restrictions:\n\n - kmin \\\u003c kmax,\n - kmin \\\u003e= kmax / 2 + 1; and\n - kmax - kmin \\\u003c= 30.\n\n If any of these restrictions are not met, they will be enforced\n automatically.\n\n`-metadata string`\n\n: A comma separated list of metadata to copy from the input to the output if\n present. Valid values: `all`, `none`, `icc`, `xmp`. The default is `xmp`.\n\n`-f int`\n\n: For lossy encoding only (specified by the `-lossy` option). Specify the\n strength of the deblocking filter, between `0` (no filtering) and `100`\n (maximum filtering). A value of `0` will turn off any filtering. Higher\n value will increase the strength of the filtering process applied after\n decoding the picture. The higher the value the smoother the picture will\n appear. Typical values are usually in the range of `20` to `50`.\n\n`-mt`\n\n: Use multi-threading for encoding, if possible.\n\n`-loop_compatibility`\n\n: If enabled, handle the loop information in a compatible fashion for Chrome\n version prior to M62 (inclusive) and Firefox.\n\n`-v`\n\n: Print extra information.\n\n`-quiet`\n\n: Do not print anything.\n\nBugs\n----\n\n- Please report all bugs to our issue tracker: \u003chttps://issues.webmproject.org\u003e\n\n- Patches welcome! See this page to get started: \u003chttps://www.webmproject.org/code/contribute/submitting-patches/\u003e\n\nExamples\n--------\n\n gif2webp picture.gif -o picture.webp\n gif2webp -q 70 picture.gif -o picture.webp\n gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp\n gif2webp -lossy -f 50 picture.gif -o picture.webp\n gif2webp -min_size -q 30 -o picture.webp -- ---picture.gif\n cat picture.gif | gif2webp -o - -- - \u003e output.webp\n\nAuthors\n-------\n\n`gif2webp` is part of `libwebp`, and was written by the WebP team.\nThe latest source tree is available at\n\u003chttps://chromium.googlesource.com/webm/libwebp/\u003e\n\nThis manual page was written by Urvang Joshi [urvang@google.com](mailto:urvang@google.com), for the\nDebian project (and may be used by others)."]]