0.1.1 • Published 6 years ago

photo2cartoon v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Cartoonlize Your Photo

A tool for converting photos into cartoon-like image. Written in nodejs, depended on Jimp.

raw cartoonlized

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.

0.1.1

6 years ago

0.1.0

6 years ago