Webpmux
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
名称
webpmux
-- 基于非动画形式的 WebP 图片创建动画 WebP 文件;
从动画 WebP 图片中提取帧,并管理 XMP/EXIF 元数据
和 ICC 配置文件。
摘要
webpmux -get GET_OPTIONS INPUT -o OUTPUT
webpmux -set SET_OPTIONS INPUT -o OUTPUT
webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT
webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ]
[ -bgcolor BACKGROUND_COLOR ] -o OUTPUT
webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT
webpmux -info INPUT
webpmux [-h|-help]
webpmux -version
webpmux argument_file_name
说明
webpmux
可用于从动画 WebP 文件中创建/提取内容,以及
添加/提取/删除 XMP/EXIF 元数据和 ICC 配置文件。
如果以
参数,命令行参数实际上是从此文件令牌化的。
这样可轻松编写脚本或使用大量参数。
选项
GET_OPTIONS(-get
)
icc
- 获取 ICC 配置文件。
exif
- 获取 EXIF 元数据。
xmp
- 获取 XMP 元数据。
frame n
- 从动画图片中获取第 N 帧。(n = 0 具有特殊含义:最后一个
帧)
SET_OPTIONS(-set
项)
loop LOOP_COUNT
- 设置动画文件的循环次数。
地点:“LOOP_COUNT”必须在 [0, 65535] 范围内。
bgcolor BACKGROUND_COLOR
- 设置动画背景颜色。
icc file.icc
- 设置 ICC 配置文件。
其中:“file.icc”包含要设置的 ICC 配置文件。
exif file.exif
- 设置 EXIF 元数据。
其中:“file.exif”包含要设置的 EXIF 元数据。
xmp file.xmp
- 设置 XMP 元数据。
其中:“file.xmp”包含要设置的 XMP 元数据。
STRIP_OPTIONS(-strip
个)
icc
- 移除 ICC 配置文件。
exif
- 移除 EXIF 元数据。
xmp
- 移除 XMP 元数据。
DURATION_OPTIONS(-duration
)
修改特定间隔的帧的时长。只有
对动画 WebP 有效,对单帧文件没有影响。
duration[,start[,end]]
其中:
duration
是以毫秒为单位的间隔时长(必需)。
必须是非负数。start
是间隔的起始帧索引
(可选)。end
是间隔的结束帧索引(含此索引)
(可选)。
此选项的三种典型用法如下:
-
-duration d
将时长设为“d”整个动画。
-duration d,f
设置“f”帧的时长“d”
-duration d,start,end
将时长设为“d”。
请注意,超出 [start, end]
间隔的帧将会保留
不受影响。end
值 0
具有特殊含义“
动画”。
温馨提示:
帧索引从 1
开始。
FRAME_OPTIONS(-frame
条)
根据多张(非动画)WebP 图片创建动画 WebP 文件。
file_i +di[+xi+yi[+mi[bi]]]
- 其中:
file_i
是第 i 帧(WebP 格式),xi
,yi
则指定
此帧的图像偏移量,di
是下一帧之前的暂停时长,
mi
是此帧的处置方法(0
表示 NONE 或 1
BACKGROUND)和 bi
是此帧的混合方法(使用 +b
表示 BLEND)
或 -b
代表 NO_BLEND)。参数 bi
可以省略,默认为
+b
(混合)。此外,如果省略 bi
,则可以省略 mi
,
默认为 0
(无)。最后,如果省略 mi
和 bi
,则 xi
和
yi
可以省略,默认为 +0+0
。
LOOP_COUNT
动画重复播放的次数。
有效范围为 0 到 65535 [默认值:0(无限)]。
BACKGROUND_COLOR
画布的背景颜色。
其中:A
、R
、G
和 B
是 0
到 255
范围内的整数,用于指定
分别为 Alpha、Red、Green 和 Blue 分量值
[默认值:255,255,255,255
]。
WebP 格式的输入文件。
输出 (-o
)
WebP 格式的输出文件。
注意:系统不会检查 EXIF、XMP 和 ICC 数据的性质,并假设
才有效。
错误
示例
添加 ICC 配置文件:
webpmux -set icc image_profile.icc in.webp -o icc_container.webp
提取 ICC 配置文件:
webpmux -get icc icc_container.webp -o image_profile.icc
删除 ICC 配置文件:
webpmux -strip icc icc_container.webp -o without_icc.webp
添加 XMP 元数据:
webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp
提取 XMP 元数据:
webpmux -get xmp xmp_container.webp -o image_metadata.xmp
移除 XMP 元数据:
webpmux -strip xmp xmp_container.webp -o without_xmp.webp
添加 EXIF 元数据:
webpmux -set exif image_metadata.exif in.webp -o exif_container.webp
提取 EXIF 元数据:
webpmux -get exif exif_container.webp -o image_metadata.exif
删除 EXIF 元数据:
webpmux -strip exif exif_container.webp -o without_exif.webp
使用 3 张(非动画)WebP 图片创建动画 WebP 文件:
webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 \
-frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 \
-o anim_container.webp
从动画 WebP 文件中获取第 2 帧:
webpmux -get frame 2 anim_container.webp -o frame_2.webp
使用 -get/-set/-strip 和以“-”开头的输入文件名:
webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp
webpmux -get icc -o image_profile.icc -- ---icc_container.webp
webpmux -strip icc -o without_icc.webp -- ---icc_container.webp
作者
webpmux
是 libwebp
的一部分,由 WebP 团队编写。
最新的源代码树位于
https://chromium.googlesource.com/webm/libwebp/
本手册页面由 Vikas Arora vikaas.arora@gmail.com 撰写,
Debian 项目(可能被其他人使用)。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):2025-08-08。"],[[["\u003cp\u003e\u003ccode\u003ewebpmux\u003c/code\u003e is a command-line tool used to create and manipulate WebP images, including animated WebP files.\u003c/p\u003e\n"],["\u003cp\u003eIt allows for adding, extracting, and stripping metadata like ICC profiles, EXIF, and XMP, as well as setting animation loop counts and background colors.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ewebpmux\u003c/code\u003e can extract specific frames from animated WebP files and assemble animations from individual WebP images.\u003c/p\u003e\n"],["\u003cp\u003eUsers can manage frame durations and disposal methods within animated WebP files using the provided options.\u003c/p\u003e\n"],["\u003cp\u003eFor detailed usage and bug reporting, refer to the provided links within the documentation.\u003c/p\u003e\n"]]],["`webpmux` manages WebP files, enabling creation, extraction, and modification of animated WebP images. Key actions include using `-get` to retrieve ICC, EXIF, or XMP metadata, or a specific frame. Use `-set` to add metadata, set loop count, or modify background color. `-strip` removes metadata, while `-frame` creates animations from still images. The `-duration` option adjusts frame durations. You can use a loop count, set a backgroud color and create animated webp files with multiple frames.\n"],null,["# webpmux\n\nName\n----\n\n`webpmux` -- Create animated WebP files from non-animated WebP images,\nextract frames from animated WebP images, and manage XMP/EXIF metadata\nand ICC profile.\n\nSynopsis\n--------\n\n webpmux -get GET_OPTIONS INPUT -o OUTPUT\n webpmux -set SET_OPTIONS INPUT -o OUTPUT\n webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT\n webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ]\n [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT\n webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT\n webpmux -info INPUT\n webpmux [-h|-help]\n webpmux -version\n webpmux argument_file_name\n\nDescription\n-----------\n\n`webpmux` can be used to create/extract from animated WebP files, as well as\nto add/extract/strip XMP/EXIF metadata and ICC profile.\nIf a single file name (not starting with the character '-') is supplied as\nthe argument, the command line arguments are actually tokenized from this file.\nThis allows for easy scripting or using a large number of arguments.\n\nOptions\n-------\n\n### GET_OPTIONS (`-get`)\n\n`icc`\n: Get ICC profile.\n\n`exif`\n: Get EXIF metadata.\n\n`xmp`\n: Get XMP metadata.\n\n`frame n`\n: Get nth frame from an animated image. (n = 0 has a special meaning: last\n frame)\n\n### SET_OPTIONS (`-set`)\n\n`loop LOOP_COUNT`\n: Set loop count on an animated file.\n Where: 'LOOP_COUNT' must be in range \\[0, 65535\\].\n\n`bgcolor BACKGROUND_COLOR`\n: Set the animation background color.\n\n`icc file.icc`\n: Set ICC profile.\n Where: 'file.icc' contains the ICC profile to be set.\n\n`exif file.exif`\n: Set EXIF metadata.\n Where: 'file.exif' contains the EXIF metadata to be set.\n\n`xmp file.xmp`\n: Set XMP metadata.\n Where: 'file.xmp' contains the XMP metadata to be set.\n\n### STRIP_OPTIONS (`-strip`)\n\n`icc`\n: Strip ICC profile.\n\n`exif`\n: Strip EXIF metadata.\n\n`xmp`\n: Strip XMP metadata.\n\n### DURATION_OPTIONS (`-duration`)\n\nAmend the duration of a specific interval of frames. This option is only\neffective on animated WebP and has no effect on a single-frame file.\n\n`duration[,start[,end]]`\n\n: Where:\n `duration` is the duration for the interval in milliseconds (mandatory).\n Must be non-negative. `start` is the starting frame index of the interval\n (optional). `end` is the ending frame index (inclusive) of the interval\n (optional).\n\n The three typical usages of this option are:\n\n `-duration d`\n\n : set the duration to 'd' for the whole animation.\n\n `-duration d,f`\n\n : set the duration of frame 'f' to 'd'.\n\n `-duration d,start,end`\n\n : set the duration to 'd' for the whole \\[start,end\\] interval.\n\n Note that the frames outside of the `[start, end]` interval will remain\n untouched. The `end` value `0` has the special meaning 'last frame of\n the animation'.\n\n Reminder:\n frame indexing starts at `1`.\n\n### FRAME_OPTIONS (`-frame`)\n\nCreate an animated WebP file from multiple (non-animated) WebP images.\n\n`file_i +di[+xi+yi[+mi[bi]]]`\n: Where: `file_i` is the i'th frame (WebP format), `xi`,`yi` specify the\n image offset for this frame, `di` is the pause duration before next frame,\n `mi` is the dispose method for this frame (`0` for NONE or `1` for\n BACKGROUND) and `bi` is the blending method for this frame (`+b` for BLEND\n or `-b` for NO_BLEND). Argument `bi` can be omitted and will default to\n `+b` (BLEND). Also, `mi` can be omitted if `bi` is omitted and will\n default to `0` (NONE). Finally, if `mi` and `bi` are omitted then `xi` and\n `yi` can be omitted and will default to `+0+0`.\n\n### LOOP_COUNT\n\nNumber of times to repeat the animation.\nValid range is 0 to 65535 \\[Default: 0 (infinite)\\].\n\n### BACKGROUND_COLOR\n\nBackground color of the canvas.\nWhere: `A`, `R`, `G` and `B` are integers in the range `0` to `255` specifying\nthe Alpha, Red, Green and Blue component values respectively\n\\[Default: `255,255,255,255`\\].\n\n### INPUT\n\nInput file in WebP format.\n\n### OUTPUT (`-o`)\n\nOutput file in WebP format.\n\n**Note:** The nature of EXIF, XMP and ICC data is not checked and is assumed\nto be valid.\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\nAdd ICC profile: \n\n webpmux -set icc image_profile.icc in.webp -o icc_container.webp\n\nExtract ICC profile: \n\n webpmux -get icc icc_container.webp -o image_profile.icc\n\nStrip ICC profile: \n\n webpmux -strip icc icc_container.webp -o without_icc.webp\n\nAdd XMP metadata: \n\n webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp\n\nExtract XMP metadata: \n\n webpmux -get xmp xmp_container.webp -o image_metadata.xmp\n\nStrip XMP metadata: \n\n webpmux -strip xmp xmp_container.webp -o without_xmp.webp\n\nAdd EXIF metadata: \n\n webpmux -set exif image_metadata.exif in.webp -o exif_container.webp\n\nExtract EXIF metadata: \n\n webpmux -get exif exif_container.webp -o image_metadata.exif\n\nStrip EXIF metadata: \n\n webpmux -strip exif exif_container.webp -o without_exif.webp\n\nCreate an animated WebP file from 3 (non-animated) WebP images: \n\n webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 \\\n -frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 \\\n -o anim_container.webp\n\nGet the 2nd frame from an animated WebP file: \n\n webpmux -get frame 2 anim_container.webp -o frame_2.webp\n\nUsing -get/-set/-strip with input file name starting with '-': \n\n webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp\n webpmux -get icc -o image_profile.icc -- ---icc_container.webp\n webpmux -strip icc -o without_icc.webp -- ---icc_container.webp\n\nAuthors\n-------\n\n`webpmux` 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 Vikas Arora [vikaas.arora@gmail.com](mailto:vikaas.arora@gmail.com), for\nthe Debian project (and may be used by others)."]]