CamanJS icon indicating copy to clipboard operation
CamanJS copied to clipboard

Remove Current Filter to apply new filter

Open myjangle opened this issue 11 years ago • 3 comments

Ok, so i applied one filter to an image after that i applied another but the problem here is that second filter is applied on top of the first filter that i applied like a stack e.g Second Filter <---> First Filter <---> Image

how do stop it to do this any help will be appreciated. Anyways Tnx

myjangle avatar May 18 '13 12:05 myjangle

The easiest way to get around this is to keep a copy of the original image around. When applying a filter, clone the img element, create a new caman object and apply the filter. When you want to apply a different filter, do the same thing and remove the previous clone.

sandbochs avatar Sep 04 '13 20:09 sandbochs

tnx!

myjangle avatar Sep 13 '13 16:09 myjangle

Is there no way to simply remove an applied filter? For instance, if I apply a greyscale filter like this...

Caman("#canvas", function() { this.greyscale().render(); });

...is there a way to just remove the greyscale filter later without doing anything else to the canvas? The usage guides show how to apply filters, but don't say anything about removing them.

I'm aware of this.revert(), but that reverts the canvas entirely; I want to specifically remove an applied filter without touching the canvas otherwise.

daGUY avatar Sep 08 '14 20:09 daGUY