iwsfg / node-potrace Goto Github PK
View Code? Open in Web Editor NEWJavaScript port of Potrace, for NodeJS
License: GNU General Public License v2.0
JavaScript port of Potrace, for NodeJS
License: GNU General Public License v2.0
I’m trying to developing a bitmap tracing plugin for Sketch, and wondering if I can work out how to use node-potrace?
The Sketch API allows me to access an image’s ImageData https://developer.sketch.com/reference/api/#imagedata
ImageData is a wrapper around a native NSImage, allowing you to access the native NSImage or a native NSData representation of the image.
Is there a Potrace method that can take the image data as an argument and return an SVG string?
I can only see a description of how to use Potrace to convert images by supplying the path to an image file:
potrace.trace('./path/to/image.png', function(err, svg) {
/*...*/
});
I’ve developed a few Sketch plugins before, but I’m a designer who likes to code, not a developer, so this might be harder than I can manage. If there is a straight forward way of making use of Potrace, I’d really appreciate your help.
Hi, would you mind update the license to GPLv3 or or license it as "GPLv2 or any later version"?
In our frontend project it's basically the only library which comes with GPLv2 from more than 1500 packages. Unfortunately GPLv2 doesn't play well with Apache2, at least the lawyers say so.
jimp is installed as 0.2.28, but 0.5.3 is available.
I have an image with 2 polygons.
When I run potrace, it serves a unique path with a M
for breaking the 2 paths.
I'd need actually 2 paths. native Potrace has a --flat
option. I tried
potrace.trace({
flat: false
})
But it doesn't work. Is this intended ?
Change in supported Node versions was probably a breaking change though and Major version number should have been bumped instead of patch number in 2.1.2.
Oops.
Hopefully nobody's using Node 0.12 and Node 4 anymore
Posterizer.STEPS_AUTO = -1;
It appears that the default value should be 1 and not -1. The validation in setParameters
is looking for a number between 1 and 255.
if (params.steps && !Array.isArray(params.steps) && (!utils.isNumber(params.steps) || !utils.between(params.steps, 1, 255))) { throw new Error('Bad \'steps\' value'); }
var bitmap = new Bitmap(image.bitmap.width, image.bitmap.height);
^
TypeError: Cannot read properties of undefined (reading 'bitmap')
help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.