GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dennwc/gotrace: [DEPRECATED] Pure Go implementation of Potrace vectorization library

This repository was archived by the owner on Jul 26, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
bindings
bindings
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bitmap.go
bitmap.go
 
 
curve.go
curve.go
 
 
decompose.go
decompose.go
 
 
go.mod
go.mod
 
 
gotrace.go
gotrace.go
 
 
gotrace_test.go
gotrace_test.go
 
 
helper.go
helper.go
 
 
trace.go
trace.go
 
 

Repository files navigation

GoTrace

WARNING: This library is deprecated in favor of gotranspile/gotrace. It will not receive any updates.

Pure Go implementation of Potrace vectorization library. Supports simple SVG output generation.

Also includes cgo bindings for the original Potrace library.

Original image

Original

Vectorized image

Vectorized

Installation

go get github.com/dennwc/gotrace

Usage

Process image with an alpha channel, generate SVG:

bm := gotrace.NewBitmapFromImage(img, nil)
paths, _ := gotrace.Trace(bm, nil)
gotrace.WriteSvg(file, img.Bounds(), paths, "")

Custom threshold function:

bm := gotrace.NewBitmapFromImage(img, func(x, y int, c color.Color) bool {
    r, g, b, _ := c.RGBA()
    return r + g + b > 128
})
paths, _ := gotrace.Trace(bm, nil)

About

[DEPRECATED] Pure Go implementation of Potrace vectorization library

github.com/gotranspile/gotrace

Topics

golangpotracesvgvectorization

Resources

Readme
GPL-2.0 license
Activity

Stars

55 stars

Watchers

1 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.