jankovicsandras / imagetracerjs

Simple raster image tracer and vectorizer written in JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to disallow splines/curves, etc. (possibility to use straight lines only)

Brixomatic opened this issue · comments

Reason: I tied vectorizing an image and that worked pretty well (it's a male silhouette), unfortunately I can't switch off drawing curves, but I'd like the shape aproximated by straight lines only.
As I understood the source, it tries to approximate with a line first, then some sort of curved shape and if that fails tries to recursively break the path up.
This should be optional.

Hi,

Have you tried the 'sharp' option preset or using very small qtres, e. g. 0.0001 ? This will practically force straight lines.

You can also comment out everything between lines 783 - 805 to deactivate Q splines. Or hack svgpathstring() to always render only L segments.

Can you test and give me feedback whether some of these solve your problem?

Using very small qrtes does the trick, thank you.

(maybe this should be more apparrent in the readme)