photo2cartoon
v0.1.1
Published
Cartoonlize your photo
Downloads
2
Readme
Cartoonlize Your Photo
A tool for converting photos into cartoon-like image. Written in nodejs, depended on Jimp.
Installation
npm install photo2cartoon
Usage
Basic Usage
let Cartoonlization = require("photo2cartoon");
let c = new Cartoonlization();
c.init("./resource/raw/test7.jpg").then((cs)=>{
let c = cs[0];
c.make();
c.toFile("./test.png");
});
With Customized Option
A default opt
will put into use, if not specified another.
You can pass a customized option to constructor.
let c = new Cartoonlization(opt)
Below is the default opt
:
let DEFAULT_OPT = {
blurMode: {
name: "bilateral",
radius: 5
},
edgeWeakening: 50,
resize: true
}
blurMode.name:
bilateral
: use bilateral filter to blur. Cost longer time.
gaussian
: perform gaussian blur.
fast
: perform mean-value filter
resize
Resize the input image to 400px width, and scale the height accordingly.