img2webp1
Create animated webp file from a sequence of input images.
Usage
img2webp [file_options]
[[frame_options]
frame_file] ...
[-o
webp_file]
img2webp argument_file_name
Overview
This manual page documents the img2webp command.
img2webp compresses a sequence of images using the animated WebP format. Input images can either be PNG, JPEG, TIFF or WebP. If a single file name (not starting with the character '-') is supplied as the argument, the command line arguments are actually tokenized from this file. This allows for easy scripting or using a large number of arguments.
Options
The file-level options are applied at the beginning of the compression process, before the input frames are read.
-ostring-
Specify the name of the output WebP file.
-
-min_size -
Encode images to achieve smallest size. This disables key frame insertion and picks the parameters resulting in the smallest output for each frame. It uses lossless compression by default, but can be combined with -q, -m, -lossy or -mixed options.
-kminint
-kmaxint-
Specify the minimum and maximum distance between consecutive key frames (independently decodable frames) in the output animation. The tool will insert some key frames into the output animation as needed so that this criteria is satisfied.
-mixedMixed compression mode: optimize compression of the image by picking either lossy or lossless compression for each frame heuristically. This global option disables the local option-lossyand-lossless.
-near_losslessint-
Specify the level of near-lossless image preprocessing. This option adjusts pixel values to help compressibility, but has minimal impact on the visual quality. It triggers lossless compression mode automatically. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default). The typical value is around 60. Note that lossy with -q 100 can at times yield better results.
-
-sharp_yuv -
Use more accurate and sharper RGB->YUV conversion. Note that this process is slower than the default 'fast' RGB->YUV conversion.
-loopint-
Specifies the number of times the animation should loop. Using '0' means 'loop indefinitely'.
-
-v -
Be more verbose.
-
-h, -help -
A short usage summary.
-
-version -
Print the version numbers of the relevant libraries used.
Options
The per-frame options are applied for the images following as arguments in the command line. They can be modified any number of times preceding each particular input image.
-dint-
Specify the image duration in milliseconds.
-
-lossless, -lossy -
Compress the next image(s) using lossless or lossy compression mode. The default mode is lossless.
-qfloat-
Specify the compression factor between 0 and 100. The default is 75.
-mint-
Specify the compression method to use. This parameter controls the trade off between encoding speed and the compressed file size and quality. Possible values range from 0 to 6. Default value is 4. When higher values are used, the encoder will spend more time inspecting additional encoding possibilities and decide on the quality gain. Lower value can result in faster processing time at the expense of larger file size and lower compression quality.
-
-exact, -noexact -
Preserve or alter RGB values in transparent area. The default is
-noexact, to help compressibility. Note-noexactmay cause artifacts in frames compressed with-lossy.
Exit status
If there were no problems during execution, img2webp exits with the value of the C constant EXIT_SUCCESS. This is usually zero.
If an error occurs, img2webp exits with the value of the C constant EXIT_FAILURE. This is usually one.
Examples
img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp
Releases
5 releases since Debian 10 (Buster); the text changed 2 times.
-exact since Debian 13 (Trixie);
-noexact since Debian 13 (Trixie);
-sharp_yuv since Debian 13 (Trixie);
-version since Debian 12 (Bookworm).