Skip to content

Instantly share code, notes, and snippets.

@AndikaR
Created May 21, 2018 02:03
Show Gist options
  • Save AndikaR/bf360e726630e83e4adc68cfd369c7be to your computer and use it in GitHub Desktop.
Save AndikaR/bf360e726630e83e4adc68cfd369c7be to your computer and use it in GitHub Desktop.
Example of Node Graphic Magic
var fse = require('fs-extra');
let gm = require('gm');
var readStream = fse.createReadStream('./public/test.png');
gm(readStream, 'test.png')
.borderColor('#000')
.trim()
.crop(50, 50, 0, 0)
.write('./public/test-1.png', function (err) {
if (!err) console.log('done');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment