A typescript port of Potrace
base on potrace javascript version
The name of the algorithm derives from the fact that it uses polygons as an intermediate representation of images, there ara many other trace project, and I think vtrace[https://github.com/visioncortex/vtracer] is amazing project which could convert a png to svg with color very fast.
A detailed technical description of how the Potrace algorithm works PDF