gotraceb

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2021 License: GPL-2.0, GPL-2.0 Imports: 6 Imported by: 0

README

GoTrace

Go bindings for Potrace vectorization library. Supports simple SVG output generation.

Original image

Original

Vectorized image

Vectorized

Installation

apt-get install libpotrace-dev
go get github.com/dennwc/gotrace/bindings

Usage

Process image, generate SVG:

paths, _ := gotraceb.Trace(img, nil)
gotraceb.WriteSvg(file, img.Bounds(), paths, "")

Custom threshold function:

params := gotraceb.Defaults()
params.ThresholdFunc = func(c color.Color) bool {
  r,g,b,_ := c.RGBA()
  return r+g+b > 128
}
paths, _ := gotraceb.Trace(img, params)

Documentation

Overview

Package gotrace provides bindings for potracelib - bitmap to vector graphics converter. More info at http://potrace.sourceforge.net/potracelib.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trace

func Trace(bm *gtr.Bitmap, param *gtr.Params) ([]gtr.Path, error)

func Version

func Version() string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL