LinuxCommandLibrary

gif2webp

Convert GIF images to WebP format

TLDR

Convert a GIF image to WebP

$ gif2webp [path/to/image.gif] -o [path/to/image.webp]
copy

SYNOPSIS

gif2webp [options] input.gif -o output.webp

PARAMETERS

-lossy
    Encode image using lossy compression.

-mixed
    Mixed lossy/lossless mode auto-decision.

-q
    Specify the compression quality factor between 0 and 100. Default is 75.

-min_size
    Encode image to reach small size. Disable key-frame insertion.

-kmin
    Minimum interval between key-frames (0=disable key-frames, default=9).

-kmax
    Maximum interval between key-frames (default=17).

-f
    Filter strength, between 0 (off) and 100 (strongest). Default is 60.

-metadata
    Comma separated list of metadata to copy from the input to the output if present: all, none, icc, xmp (default).

-near_lossless
    Preprocess near-lossless image by adjusting color values. Range: 0 (maximum preprocessing) to 100 (no preprocessing). Default: 60.

-o
    Specify the output file name. If omitted, gif2webp will perform compression but only report statistics.

-loop
    Number of animation loop. Default: 0 (infinite loop).

-mt
    Use multi-threading for encoding, if possible.

-v
    Be verbose.

-version
    Print version number and exit.

-h, -help
    Display usage summary.

-s x
    Resize the source images. Warning: Using resize is memory intensive, specially with large images

input.gif
    The input GIF image file.

DESCRIPTION

gif2webp is a command-line tool that converts GIF (Graphics Interchange Format) images to the WebP format.
WebP offers superior lossless and lossy compression for images on the web, making them smaller and faster to load. The gif2webp utility analyzes the input GIF, determines the best encoding settings for WebP, and then performs the conversion. This conversion typically results in a smaller file size without significant loss of visual quality.
It supports various options for controlling the encoding process, such as setting the quality level, specifying the maximum number of colors, and choosing between lossless and lossy compression. Using gif2webp can improve website performance by reducing image download times and bandwidth consumption.

CAVEATS

Not all GIF features may be perfectly preserved during conversion to WebP. Transparency handling and color palette optimization might exhibit slight differences.

EXIT STATUS

Returns 0 if conversion was successful, 1 if there was an error.

HISTORY

gif2webp is part of the WebP codec suite, developed by Google. It was created to provide an efficient way to convert GIF images to the more modern WebP format. WebP aims to provide better compression and image quality compared to older formats like GIF, ultimately improving web performance. The command has been regularly updated as part of the WebP project to enhance its functionality and performance. It has become a standard tool for web developers seeking to optimize images for faster loading times.

SEE ALSO

cwebp(1), dwebp(1), webpmux(1)

Copied to clipboard