gif2webp
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نام
gif2webp
-- تبدیل یک تصویر GIF به WebP
خلاصه داستان
gif2webp [options] input_file.gif -o output_file.webp
توضیحات
gif2webp
یک تصویر GIF را به یک تصویر WebP تبدیل می کند.
گزینه ها
گزینه های اساسی عبارتند از:
-
-o string
- نام فایل WebP خروجی را مشخص کنید. اگر حذف شود،
gif2webp
تبدیل را انجام می دهد اما فقط آمار را گزارش می دهد. استفاده از "-" به عنوان نام خروجی، خروجی را به "stdout" هدایت می کند. -
-- string
- فایل ورودی را به صراحت مشخص کنید. برای مثال اگر فایل ورودی با "-" شروع شود، این گزینه مفید است. این گزینه باید آخرین نمایش داده شود. هر گزینه دیگری پس از آن نادیده گرفته خواهد شد. اگر فایل ورودی "-" باشد، داده ها به جای فایل از "stdin" خوانده می شوند.
-
-h, -help
- اطلاعات استفاده
-
-version
- شماره نسخه را چاپ کنید (به عنوان major.minor.revision) و خارج شوید.
-
-lossy
- تصویر را با استفاده از فشرده سازی با اتلاف رمزگذاری کنید.
-
-mixed
- حالت فشرده سازی مختلط: فشرده سازی تصویر را با انتخاب فشرده سازی با اتلاف یا بدون تلفات برای هر فریم به صورت اکتشافی بهینه کنید.
-
-q float
- ضریب فشرده سازی کانال های RGB بین
0
تا 100
را مشخص کنید. پیش فرض 75
است. در صورت فشردهسازی بدون اتلاف (پیشفرض)، یک عامل کوچک سرعت فشردهسازی را سریعتر میکند، اما فایل بزرگتری تولید میکند. حداکثر فشرده سازی با استفاده از مقدار 100
به دست می آید. در صورت فشردهسازی با اتلاف (که توسط گزینه -lossy مشخص شده است)، یک عامل کوچک فایل کوچکتری با کیفیت پایینتر تولید میکند. بهترین کیفیت با استفاده از مقدار 100
به دست می آید. -
-min_size
- برای دستیابی به کوچکترین اندازه، تصویر را رمزگذاری کنید. این کار درج قاب کلید را غیرفعال می کند و روش دفع را انتخاب می کند که منجر به کوچکترین خروجی برای هر فریم می شود. به طور پیش فرض از فشرده سازی بدون اتلاف استفاده می کند، اما می تواند با گزینه های
-q
، -m
، -lossy
یا -mixed
ترکیب شود. -
-m int
- روش فشرده سازی مورد استفاده را مشخص کنید. این پارامتر تعادل بین سرعت کدگذاری و اندازه و کیفیت فایل فشرده را کنترل می کند. مقادیر ممکن از
0
تا 6
متغیر است. مقدار پیش فرض 4
است. هنگامی که مقادیر بالاتر استفاده می شود، رمزگذار زمان بیشتری را صرف بررسی احتمالات رمزگذاری اضافی می کند و در مورد افزایش کیفیت تصمیم می گیرد. مقدار کمتر میتواند منجر به زمان پردازش سریعتر در هزینه حجم فایل بیشتر و کیفیت فشردهسازی پایینتر شود. -
-kmin int
، -kmax int
حداقل و حداکثر فاصله بین فریم های کلیدی متوالی (فریم های قابل رمزگشایی مستقل) را در انیمیشن خروجی مشخص کنید. ابزار برخی از فریم های کلیدی را در صورت نیاز به انیمیشن خروجی وارد می کند تا این معیار برآورده شود.
مقدار kmax
0
، درج فریم های کلیدی را خاموش می کند. مقدار kmax
1
باعث می شود که همه فریم ها فریم های کلیدی باشند. مقدار kmin
در هر دو مورد خاص در نظر گرفته نمی شود. مقادیر معمولی در محدوده 3
تا 30
هستند. مقادیر پیشفرض kmin
= 9
، kmax
= 17
برای فشردهسازی بدون تلفات و kmin
= 3
، kmax
= 5
برای فشردهسازی با تلفات هستند.
این دو گزینه فقط برای تصاویر متحرک با تعداد فریم زیاد (>50) مرتبط هستند.
هنگامی که مقادیر کمتری استفاده می شود، فریم های بیشتری به فریم های کلیدی تبدیل می شوند. این ممکن است منجر به تعداد کمتر فریم های مورد نیاز برای رمزگشایی یک فریم به طور متوسط شود و در نتیجه عملکرد رمزگشایی را بهبود بخشد. اما این ممکن است به اندازه فایل کمی بزرگتر منجر شود. مقادیر بالاتر ممکن است منجر به عملکرد رمزگشایی بدتر شود، اما اندازه فایل کوچکتر.
برخی محدودیت ها:
- kmin < kmax
- kmin >= kmax / 2 + 1; و
- kmax - kmin <= 30.
اگر هر یک از این محدودیت ها رعایت نشود، به طور خودکار اعمال می شود.
-
-metadata string
فهرستی از فراداده جدا شده با کاما برای کپی کردن از ورودی به خروجی در صورت وجود. مقادیر معتبر: all
، none
، icc
، xmp
. پیش فرض xmp
است.
-
-f int
فقط برای رمزگذاری با اتلاف (که توسط گزینه -lossy
مشخص شده است). قدرت فیلتر رفع انسداد را بین 0
(بدون فیلتر) و 100
(حداکثر فیلتر) مشخص کنید. مقدار 0
هر فیلتری را خاموش می کند. مقدار بالاتر، قدرت فرآیند فیلتر اعمال شده پس از رمزگشایی تصویر را افزایش می دهد. هر چه مقدار بالاتر باشد تصویر صاف تر ظاهر می شود. مقادیر معمولی معمولاً در محدوده 20
تا 50
هستند.
-
-mt
در صورت امکان از چند رشته برای رمزگذاری استفاده کنید.
-
-loop_compatibility
در صورت فعال بودن، اطلاعات حلقه را به روشی سازگار برای نسخه Chrome قبل از M62 (شامل) و Firefox مدیریت کنید.
-
-v
چاپ اطلاعات اضافی
-
-quiet
چیزی چاپ نکنید.
اشکالات
نمونه ها
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
نویسندگان
gif2webp
بخشی از libwebp
است و توسط تیم WebP نوشته شده است. آخرین درخت منبع در https://chromium.googlesource.com/webm/libwebp/ موجود است
این صفحه راهنما توسط Urvang Joshi urvang@google.com برای پروژه Debian نوشته شده است (و ممکن است توسط دیگران استفاده شود).
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-08 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-08 بهوقت ساعت هماهنگ جهانی."],[[["\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)."]]