photo2cartoon

0.1.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i photo2cartoon

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

1.62 MB

Total Files

21

Last publish

Collaborators

  • asskicker0214