Skip to content

Potrace algorithm to convert bitmap image to vector in the Canvas

License

Notifications You must be signed in to change notification settings

cmisenas/potrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POTRACE

Potrace is an algorithm to convert bitmap image to vector. This implementation is written in JS and uses node.js and HTML5 canvas.

This is a WORK IN PROGRESS.

Steps

  • Find all vertices in the image
  • Find all paths from the vertices
  • Determine which vertices in a path is straight
  • Calculate the optimal polygon by assigning penalties for each possible one
  • Smooth corners by calculating the bezier curves
  • Create SVG elements (path) for each straight line path generated

About

Potrace algorithm to convert bitmap image to vector in the Canvas

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published