CamanJS
CamanJS copied to clipboard
CamanJS + NodeJs imageBase64
How pass the Image Base64 and get the return in base64 ?
Caman = require('caman').Caman;
//Caman("./path/to/file.jpg", function () {
Caman( imageBlob, function () {
this.brightness(40);
this.render(function () {
//this.save("./output.png");
return imageWithFilterBlob;
});
});
I would try converting Base64 to image before passing it to CamanJS. There's a SO thread that shows how to achieve that.
And to get back the result in base64 you can access the standard canvas object in Caman instance:
Caman( imageBlob, function () {
this.brightness(40);
this.render(function () {
var base64 = this.canvas.toDataURL("image/jpeg");
});
});