Picture manipulation in javascript

134 Views Asked by At

I would like to create a module that allow user to edit picture taken from camera with some filter (color operation like saturation, intensity, ...) and some items like hats, mustache, and much more.

I will create items (png with transparent background) but I would like to find a library that can help me to add item on existing picture and maybe change color if the library allow that.

Could you tell me if there is an existing library that can help me to do that?

EDIT: I would like to save the final image in a file, not only displayed

2

There are 2 best solutions below

2
Manzik On BEST ANSWER

Take a look at fabric.js, provides what you need.
EDIT: Use this to save an image from the canvas:

var link = document.createElement("a");
link.download = "img.png";
link.href = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
link.click();
0
The_HTML_Man On

try here CamanJS

i think it is what you are looking for