node-image
node-image copied to clipboard
Merging files in the file system
Hi,
how do I create a buffer from an image I have in the file system? I want to merge multiples images into one.
I tried this and it didn't work:
var Image = require('image'); var fs = require("fs")
var bitmap = fs.readFileSync("teste.png"); var png = new Image('png').encodeSync(new Buffer(bitmap), 500, 500); fs.writeFileSync('copy.jpg', png);
It created a black image instead.
Thanks,
Giulian Drimba