Copy Image with filters from one canvas and paste to other

431 Views Asked by At

I'm using Fabric library to draw different objects on canvas and for some image i need to provide effects and filter, so i'm using Caman library. I'm providing the effects and filter functionality in popup where i added another canvas and gets the URL of selected image, but after applying effects on image through Caman librray, i need to put back that image to main canvas. But problem is, i need to put back image with same size and without resolution loss. Please help me in this regard.

1

There are 1 best solutions below

0
On

You have following method to export canvas :

toObject toSVG toJSON toDatalessJSON toDataURL('png')

you can use any one method from above you can export canvas which is there in that popup and can import to your main canvas by following methods :

loadFromJSON loadFromDatalessJSON loadSVGFromString loadSVGFromURL