-->

29.06.11

Categories: Flash, Graphics

Delaunay triangle vectorization

We have been working on vectorisation tool based on a network or irregular triangles.

contador

The technique I adapted was to create a random set of initial points, and then use a Delaunay triangulation algorithm to create a set of triangle Shape objects, which are then stored in an array.

Each triangle is then coloured using the setPixel method based on the colour value of the pixel in the underlying image in the centre of the triangle. The simplest technique for calculating the co-ordinates of the centre point of the triangle is to take the sum of the horizontal positions of the 3 vertices and divide by 3 to find the x co-ordinate, and the sum of the vertical positions of the 3 vertices and divide by 3 to find the y co-ordinate. This tells us the Centroid of the triangle.

(It turns out there are 3612 ways of calculating the center of a triangle, see the Encyclopedia of Triangle Centers).

girl4

More detail can be added by setting the number of initial points.

In the second iteration, you can add detail to a particular area, by clicking on it. This adds additional control points to the area around the mouse click, and generates more triangles.

girl

When run as a projector, select Print and then Save As a PDF to create a vector image which can be edited in Illustrator.
It’s an intriguing effect to remove some of the triangles to reveal the image beneath.

pendleton

Try it out

To use, click the load image button to load an image from your hard drive. Click on the image to add extra triangle points. Click reset to revert to the original number of triangles.

Get Adobe Flash player

Further research

For more work with Delauney triangles, see the work of Jonathan Puckey – Flickr set here

Share your love for this story

  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

No comments

Have your say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>