2.0.1 • Published 2 years ago

oslllo-potrace v2.0.1

Weekly downloads
216
License
GPL-2.0
Repository
github
Last release
2 years ago

Potrace

CI/Test npm

A "1:1 output" JavaScript port of Potrace JS for NodeJS.


Original imagePotrace output
Original ImagePotrace Output

Online Demo


Why did I create this package ❓

The issue


Prerequisites

  • Node.js v10+

Installation

npm install oslllo-potrace

Basic Usage


Taken from Example.js


Example 1

const path = require("path");
const Potrace = require("..");
const fs = require("fs-extra");
const Svg2 = require("oslllo-svg2");

async function example1() {
    var source = path.resolve("example/tree.jpg");
    var destination = path.resolve("example/tree.svg");
    var traced = await Potrace(source).trace();
    fs.writeFileSync(destination, traced);
    await Svg2(traced).png().extend(10).toFile("example/tree.png");
}

example1().then(() => {
    console.log("done");
}).catch((err) => {
    throw err;
});

Example 2

const path = require("path");
const Potrace = require("..");
const fs = require("fs-extra");
const Svg2 = require("oslllo-svg2");

async function example2() {
    var source = path.resolve("example/tree.jpg");
    var destination = path.resolve("example/tree.svg");
    var instance = Potrace(source);
    var traced = await instance.trace();
    fs.writeFileSync(destination, traced);
    await Svg2(traced).png().extend(10).toFile("example/tree.png");
}

example2().then(() => {
    console.log("done");
}).catch((err) => {
    throw err;
});

Parameters

Changelog

Please see CHANGELOG for more information what has changed recently.

Test

npm test

Credits

Potrace JS Port by @kilobtye.

Original Potrace by Peter Selinger.

Another Potrace Port For Node.js maintained by @tooolbox.

License

The GNU General Public License v2.0 (GPL-2.0). Please see License File for more information.

2.0.1

2 years ago

1.2.0

2 years ago

2.0.0

2 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago