LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dwebp

decode WebP images to other formats

TLDR

Convert WebP to PNG
$ dwebp [image.webp] -o [output.png]
copy
Convert to PPM
$ dwebp [image.webp] -ppm -o [output.ppm]
copy
Convert to BMP
$ dwebp [image.webp] -bmp -o [output.bmp]
copy
Show image info only
$ dwebp -info [image.webp]
copy
Resize while decoding (0 keeps the aspect ratio)
$ dwebp [image.webp] -resize [800] [0] -o [output.png]
copy
Crop a rectangle out of the image
$ dwebp [image.webp] -crop [x] [y] [width] [height] -o [output.png]
copy
Flip image vertically
$ dwebp -flip [image.webp] -o [output.png]
copy

SYNOPSIS

dwebp [options] input.webp -o output

DESCRIPTION

dwebp decodes WebP images to other formats. It's part of the libwebp package providing reference implementations for WebP encoding and decoding.The tool supports both lossy and lossless WebP images, including those with alpha transparency. Output format defaults to PNG unless specified otherwise.dwebp is useful for converting WebP images from web sources to formats compatible with tools that don't support WebP natively.

PARAMETERS

INPUT

WebP file to decode.
-o FILE
Output file path.
-ppm
Output PPM format.
-bmp
Output BMP format.
-tiff
Output TIFF format.
-pgm
Output PGM format (grayscale).
-pam
Output PAM format (preserves the alpha channel).
-alpha
Output only the alpha plane as a grayscale image.
-info
Print image info only.
-flip
Flip image vertically.
-crop x y w h
Decode only the given rectangle of the image.
-resize width height (or -scale)
Rescale the decoded image. A value of 0 for one dimension preserves the aspect ratio.
-nofancy
Disable fancy (higher quality) upsampling.
-nodither
Disable dithering.
-mt
Use multi-threading for decoding.
-quiet
Suppress informational output.
-v
Print decoding time.
-version
Print the library version and exit.
-h
Display help information.

INSTALL

sudo apt install webp
copy
sudo dnf install libwebp-tools
copy
sudo apk add libwebp-tools
copy
sudo zypper install libwebp-tools
copy
brew install webp
copy

CAVEATS

The output file extension does not select the format; use the format flags. Animated WebP files are not handled by dwebp, only their first frame or nothing at all: use anim_dump or webpmux for animations. PNG output is the default and requires libpng at build time.

HISTORY

dwebp is part of libwebp, Google's reference implementation of the WebP image format. WebP was introduced by Google in 2010 as an efficient image format for web use.

SEE ALSO

cwebp(1), gif2webp(1), convert(1)

RESOURCES

Copied to clipboard
Kai