Ever wanted to convert a bitmap to vector shapes, at runtime, in Flash? Look no further. Let me introduce you to as3potrace, an ActionScript 3 library to trace bitmaps.
Like potrace, as3potrace is released under GPL. The SWC and source code are available on GitHub:
Demo source code: https://gist.github.com/940219 (Warning: ugly)
A minimal example of how to trace a bitmap with as3potrace, and draw the result into a
Note that you can write your own backends to ease handling/processing of generated shapes. The one backend that i already wrote,
GraphicsData structures that you can immediately draw using
And as always, after i finished porting this little beauty, i found out that this has been done before by the amazing folks at LibSpark. Check out nitoyon’s PotrAs (also GPL’ed).