path of the input file
path of the output WebP file
Decompress a WebP file to an image file
await dwebp('me.webp', 'me.png')
await dwebp('me.webp', 'me.ppm', '-ppm')
path of the output WebP file
path of the output file (PNG format by default)
Call a libwebp binary
await execute('cwebp', ['-version'])
execute('cwebp', ['-version'], (err, version) => err? console.error(err) : console.log(version))
name of the libwebp bin to execute
list of options to pass to the libwebp bin
Convert a GIF image to WebP
await gif2webp('me.gif', 'me.webp')
await gif2webp('me.gif', 'me.webp', '-mixed')
path of the input file
path of the output WebP file
Generated using TypeDoc
Description
compresses an image using the WebP format. Input format can be either PNG, JPEG, TIFF, WebP or raw Y'CbCr samples.
Examples
await cwebp('me.jpg', 'me.webp') await cwebp('me.jpg', 'me.webp', '-lossless') await cwebp('me.jpg', 'me.webp', '-q', '50')
Params