Simple raster image tracer and vectorizer written in JavaScript.
npm install @marmooo/imagetracerSimple raster image tracer and vectorizer written in JavaScript.
``
import { OctreeQuantization } from "npm:@marmooo/color-reducer";
import { toSVG, toTraceData } from "npm:@marmooo/imagetracer";
const quantizer = OctreeQuantization(uint8, width, height);
quantizer.apply(256);
const { replaceColors } = quantizer;
const indexedImage = quantizer.getIndexedImage();
const svg = toSVG(indexedImage, width, height, replaceColors, options);
const traceData = toTraceData(indexedImage, width, height, replaceColors, options);
`
See process overview and ideas for improvement.
- simplify API from original
(imagetracerjs)
- support ESM & Deno
- support multiple quantization algorithms (use
@marmooo/color-reducer)
- minify & optimize output SVG
- add benchmarks & improve performance
- add tests & fixed some bugs
```
deno test --allow-read
deno bench --allow-read
deno run --allow-read src/svg_size.js