organism.prototype.exportPixels = function(pixels, width, height, filename, callback) { if (!callback) { callback = function() {}; } var image = new imageData({ width: width, height: height }); image.pixels = pixels; image.export(filename, callback); }
image.open(path.normalize(__dirname+"/test/origin.png"), function(err) { image.scale({ display: 'crop', // crop, fit scaleUp: false, width: 10, height: 10 }); image.export(path.normalize(__dirname+"/test/10.png"), function(filename) { console.log("Exported: ", filename); }); });