filterous-2 icon indicating copy to clipboard operation
filterous-2 copied to clipboard

Is it possible to receive filtered image?

Open ahromyak opened this issue 7 years ago • 2 comments

I want to get filtered image to insert it in to canvas. is it possible with your lib?

ahromyak avatar Mar 29 '17 14:03 ahromyak

This lib does use a canvas to manipulate an image, then export as an image, but I didn't make the "invisible" canvas image exposed to the library...

However, you should be able to manually grab the filtered image src, and use canvas drawImage() to import the image into a new canvas.

See: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage

girliemac avatar Mar 29 '17 19:03 girliemac

Hey Girliemac, similar question here. I am looking for a way to feed a canvas to Filterous as an argument or global variable so that the filters can be applied directly to that. I am filtering large image sizes (up to 4K) on mobile, and the current Filterous loop I am having to do is a conversion of an existing canvas to a data URL, to then have Filterous create a new canvas, apply my image to it, apply the filter, convert it back to a data URL and then re-render that to my existing canvas. With testing, this has shown to be slow, especially on old mobile devices.

I tried editing your code myself to grab the canvas from a global variable but am having a hard time doing so.

Any thoughts on this?

Thanks, Brian

BGitlin337 avatar Jan 24 '18 00:01 BGitlin337