简体   繁体   中英

Using Preset Filters From CamanJS API

I am using CamanJS plugin to apply effects to images, I want to know how do I apply preset effects like lomo, sin city, cross process, etc found here . The documentation of CamanJS does not elaborate on this properly.

I tried the below code to apply vignette effect , but was not successful.

Caman("#effects", function () {

        this.resize({width: 650,height: 400
         });
         this.vignette();
        this.render();

            });

The vignette filter requires a size in order to work. It can either be an absolute number or a percentage.

this.vignette(400);
this.vignette("10%");

It also takes an optional strength parameter whose range is 0-100.

this.vignette("10%", 40);

You're right though, all of the filters should be documented better.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM