Abysim / node-dwebp-bin

dwebp node.js wrapper that decode WebP to PNG.

Home Page:https://www.npmjs.org/package/dwebp-bin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status NPM version Dependency Status devDependency Status

Dependencies on Linux

WebP requires following libraries on Linux. See detail.

$ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev

Install

$ npm install --save dwebp-bin

Usage

Command Line

$ dwebp input.webp -o output.png

From source file

var execFile = require('child_process').execFile;
var dwebp = require('dwebp-bin').path;

execFile(dwebp, ['input.webp', '-o', 'output.png'], function (error) {
  if (error) {
    throw error;
  }

  console.log('Image was converted');
});

Options

Usage: dwebp in_file [options] [-o out_file]

Decodes the WebP image file to PNG format [Default]
Use following options to convert into alternate image formats:
  -pam ......... save the raw RGBA samples as a color PAM
  -ppm ......... save the raw RGB samples as a color PPM
  -bmp ......... save as uncompressed BMP format
  -tiff ........ save as uncompressed TIFF format
  -pgm ......... save the raw YUV samples as a grayscale PGM
                 file with IMC4 layout
  -yuv ......... save the raw YUV samples in flat layout

 Other options are:
  -version  .... print version number and exit
  -nofancy ..... don't use the fancy YUV420 upscaler
  -nofilter .... disable in-loop filtering
  -nodither .... disable dithering
  -dither <d> .. dithering strength (in 0..100)
  -mt .......... use multi-threading
  -crop <x> <y> <w> <h> ... crop output with the given rectangle
  -scale <w> <h> .......... scale the output (*after* any cropping)
  -flip ........ flip the output vertically
  -alpha ....... only save the alpha plane
  -incremental . use incremental decoding (useful for tests)
  -h     ....... this help message
  -v     ....... verbose (e.g. print encoding/decoding times)
  -noasm ....... disable all assembly optimizations

License

This is licensed under BSD.

WebP is licensed under Creative Commons Attribution 3.0 License.

About

dwebp node.js wrapper that decode WebP to PNG.

https://www.npmjs.org/package/dwebp-bin


Languages

Language:JavaScript 100.0%