Renders rexpaintjs-fork Images into canvas images.
Install this module by running:
npm install --save adri326/rexpaintjs-render
Then, import the node module:
const render = require('rexpaintjs-render');
You can then quickly convert your Image
s into Image
instances with the imported render
method:
const fs = require("fs");
let buffer = fs.readFileSync("your_file.xp");
rexpaint(buffer, (err, data) => {
if (err) {
throw new Error(err);
}
data.render({output: "your_file.png"}); // writes the image to `your_file.png`!
});