sylph

Image processing service

Sylph

Image optimization, processing, and spriting library.

 
var fs = require('fs'),
    Sylph = require('sylph');
 
var sylph = new Sylph();
 
var imagePath = './resources/image.jpg',
    imageStream = fs.createReadStream(imagePath);
 
sylph.detectType(imagePath, function(errtype){
  sylph.smush(imageStream, type, function(errimage){
    fs.writeFile(imagePath.replace(/jpg/, 'min.jpg'), image);
  });
});
 
  • Optimize images
  • Build requested image sizes [planned]
  • Build sprite sheet (image1&image2) [planned]
  • Imagemagick
  • jpegtran (can be installed through npm)
  • libmagic

OSX: brew install imagemagick libmagic pngcrush

Debians: sudo apt-get install imagemagick pngcrush