Package Exports
- webp-converter
- webp-converter/cwebp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webp-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
A small node.js library for converting any image to webp file format or converting webp image to any image file format.
This module uses cwebp and dwebp precompiled executables of WebP Libraries for more info visit WebP
For converting other images format to webp please read this documention cwebp Encoder
For converting webp image to other image format please read this documention dwebp Encoder
For converting gif image to webp please read this documention gif2webp Converter
How to use
//get module
var webp=require('webp-converter');
//pass input_image(.jpeg,.pnp .....) path ,output_image(give path where to save and image file name with .webp extension)
webp.cwebp("nodejs_logo.jpg","nodejs_logo.webp","-q 80",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
//pass input_image(.webp image) path ,output_image(.jpeg,.pnp .....)
webp.dwebp("nodejs_logo.webp","nodejs_logo.jpg",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
//pass input_image(.gif) path ,output_image(give path where to save and image file name with .webp extension)
webp.gwebp("nodejs_logo.gif","nodejs_logo.webp","-q 80",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
Installation
$ npm install webp-converter