Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CamanJS - replace instance

If I have an image that I apply a filter to, e.g. Lomo filter, is there way to make that the current Caman instance?

Meaning, if I then want to then play about with the brightness on the image that I applied the filter to, and use this.revert(); to reset the brightness, I want it to revert to the canvas with the filter on it that I just applied.

Is this possible?

I'm having a nightmare with trying to apply many effects, only one at once (except for preset filters), and carry the state through...

like image 746
StudioTime Avatar asked Jun 06 '13 15:06

StudioTime


1 Answers

If i understand, you want to apply filter ("Lomo") as shown on their example page and then fiddle with some properties (like brightness) and then revert changes back to "Lomo" filter?

Why not just click on filter ("Lomo") again?

EDIT: You should probably take a look at guide and implement your own method with default values like in filters.

u.Filter.register("lomo", function (D) {
        if (D == null) {
            D = true
        }
        this.brightness(15);
        this.exposure(15);
        this.curves("rgb", [0, 0], [200, 0], [155, 255], [255, 255]);
        this.saturation(-20);
        this.gamma(1.8);
        if (D) {
            this.vignette("50%", 60)
        }
        return this.brightness(5)
    });

I dont think your requirement comes "out of the box".

like image 183
Terafor Avatar answered Sep 19 '22 17:09

Terafor