broccoli-webp
v0.1.8
Published
JPEG/PNG to WebP converter for Broccoli
Downloads
1
Maintainers
Readme
broccoli-webp
This Broccoli plugin converts JPEG/PNG files to WebP.
Installation
Install just like any other broccoli plugin:
npm install --save-dev broccoli-webp
cwebp-bin is listed as an optional dependency.
If you can't install it, install cwebp manually:
- FreeBSD:
pkg install graphics/webp
- OS X:
brew install webp
- Ubuntu/Debian:
sudo apt-get install webp
Usage
var Webp = require('broccoli-webp')
var outputNode = new Webp(inputNode, options)
inputNode
: A node (tree) that contains the images you want to convert.options
: A hash of options. Currently supported:quality
(number, 0..100): compression quality for JPEGs (PNGs are converted to lossless WebP)alphaQuality
(number, 0..100): transparency qualitycompression
(number, 0 -- fast, 6 -- slowest): compression strength
Example
var Webp = require('broccoli-webp')
var img = 'img'
var webp = new Webp(img, {quality: 80})
return [img, webp]
Contributing
Please feel free to submit pull requests!
By participating in this project you agree to follow the Contributor Code of Conduct.
License
This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE
file or unlicense.org.