low
lowpoly
npm i lowpoly
low

lowpoly

Style an image with low-poly

by JrainLau

0.1.0 (see all)License:MITTypeScript:Not Found
npm i lowpoly
Readme

What's it?

lowpoly.js is a JS liberary which can style an image with Low Poly.

Img

Img

Install

npm install lowpoly

Usage

Note that lowpoly.js was written in ES6, it would work fine in the lastest version of morden browsers, or use it with Babel.

import LowPoly from 'lowpoly'

new LowPoly(src, config) .init() .then((data) => { ... })

After the init() function, it will returns a promise, which includes a base64 source of the low-poly style image.

Params

ParamTypeDescription
src{String}Address of an original image
config{Object}The configuration object

The configuration object might take 6 properties:

EDGE_DETECT_VALUE: Lower this to increase edge contrast sensitivity.

POINT_RATE: Number of points distribution ratio of points (number) on the edge, detail, generated higher see console.

POINT_MAX_NUM: Maximum points sampled. Higher = more detail.

BLUR_SIZE: Smaller is more detailed.

EDGE_SIZE: Larger is more detailed.

PIXEL_LIMIT: Images may have this many pixels at most (width x height) or will be resampled. Have had no trouble setting this to ~10,000,000 or more.

License

MIT

Downloads/wk

4

GitHub Stars

97

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.1.0
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial