Linux command
img2webp 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create animated WebP
img2webp [frame1.png] [frame2.png] [frame3.png] -o [animation.webp]
说明
img2webp creates animated WebP files from a sequence of input images. Each input frame can have individual compression settings (lossy or lossless) and duration. For single-image conversion to WebP, use cwebp instead. The tool supports both lossy and lossless compression modes per frame, with configurable animation loop count and frame durations.
参数
- -o _FILE_
- Output WebP filename
- -lossy
- Use lossy compression
- -lossless
- Use lossless compression (default)
- -q _QUALITY_
- Quality factor (0-100, default 75)
- -m _METHOD_
- Compression method (0-6, default 4)
- -loop _COUNT_
- Loop count for animations (0 = infinite)
- -d _MS_
- Frame duration in milliseconds for animations
FAQ
What is the img2webp command used for?
img2webp creates animated WebP files from a sequence of input images. Each input frame can have individual compression settings (lossy or lossless) and duration. For single-image conversion to WebP, use cwebp instead. The tool supports both lossy and lossless compression modes per frame, with configurable animation loop count and frame durations.
How do I run a basic img2webp example?
Run `img2webp [frame1.png] [frame2.png] [frame3.png] -o [animation.webp]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _FILE_ do in img2webp?
Output WebP filename