0.0.3 • Published 10 months ago

@marmooo/imagetracer v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@marmooo/imagetracer

alt bitmap to SVG

Simple raster image tracer and vectorizer written in JavaScript.

Usage

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);

Process overview

See process overview and ideas for improvement.

Features

  • 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

Test

deno test --allow-read
deno bench --allow-read
deno run --allow-read src/svg_size.js
0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

11 months ago