Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    sylphpublic

    Sylph

    v0.0.2 Image optimization, processing, and spriting library.

    Example

     
    var fs = require('fs'),
        Sylph = require('sylph');
     
    var sylph = new Sylph();
     
    var imagePath = './resources/image.jpg',
        image = fs.readFileSync(imagePath);
     
    // let's scale an image to 200x200 and then optimize it 
     
    sylph.features(image, function(err, features){
      sylph.scale(image, { height: 200 }, function(err, image) {
        sylph.smush(image, features.format, function(err, image){
          fs.writeFile(imagePath.replace(/jpg/, 'min.jpg'), image);
        });
      });
    });
     

    Features

    • Optimize images
    • Build requested image sizes
    • Build sprite sheet (image1&image2) [planned]

    Dependencies

    • Imagemagick
    • jpegtran (can be installed through npm)

    OSX: brew install imagemagick pngcrush

    Debians: sudo apt-get install imagemagick pngcrush

    Keywords

    none

    install

    npm i sylph

    Downloadslast 7 days

    4

    version

    0.0.2

    license

    none

    last publish

    collaborators

    • avatar