Skip to content

stevenwcarter/node-epeg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install:

npm install epeg

Downsize:

var epeg = require("epeg");

image = new epeg.Image({path: "./test.jpg"}))
image.downsize(100, 100).saveTo("./output.jpg");

Crop:

var epeg = require("epeg");

image = new epeg.Image({path: "./test.jpg"}))
image.crop(200, 200, 100, 100).saveTo("./output.jpg");

Both can take an optional 'quality' parameter between 1 and 100 (default is 85):

var epeg = require("epeg");

image = new epeg.Image({path: "./test.jpg"}))
image.downsize(100, 100, 50).saveTo("./ugly.jpg");

You can also use buffers as I/O:

var fs = require("fs");
var epeg = require("epeg");

fs.readFile("./test.jpg", function(err, data) {
  var image = new epeg.Image({data: data});
  buffer = image.downsize(100, 100).process();
  fs.writeFileSync("./output.jpg", buffer);
}

About

Node bindings for the Epeg library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 74.3%
  • C++ 14.5%
  • JavaScript 10.7%
  • Python 0.5%