pypotrace

Potrace Python bindings
Download

pypotrace Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Luper Rouch
  • Publisher web site:
  • http://projects.luper.fr/misc/wiki/pyflu

pypotrace Tags


pypotrace Description

Potrace Python bindings pypotrace provides an object oriented API to the potrace library.Example usage:The bindings work with input images represented as numpy arrays:import numpy as npimport potrace# Make a numpy array with a rectangle in the middledata = np.zeros((32, 32), np.uint32)data = 1# Create a bitmap from the arraybmp = potrace.Bitmap(data)# Trace the bitmap to a pathpath = bmp.trace()# Iterate over path curvesfor curve in path: print "start_point =", curve.start_point for segment in curve: print segment end_point_x, end_point_y = segment.end_point if segment.is_corner: c_x, c_y = segment.c else: c1_x, c1_y = segment.c1 c2_x, c2_y = segment.c2Installation:Make sure you have the agg and potrace development packages installed (libagg-dev and libpotrace-dev on ubuntu) and run:python setup.py installDocumentationThe documentation is hosted here: http://packages.python.org/pypotraceA copy is also included in the doc/_build/html directory of the source distribution. Requirements: · Python


pypotrace Related Software