GitHub Source

Weaver generates a spider tapestry with a two fold algorithm. The initial phase processes the image: The image is blurred with a Gaussian convolution blur, grey scaled, and then sobel filtered. A threshold is then applied to identify edges with a binary true or false. These points are pushed into list.

The White Wolf

The latter phase makes use of Delaunay Triangulation: A point from the list may freely be placed in a triangle mesh given that all triangles do not contain the point within in their circumcenters. Fortunately this will never be the case as the window is engulfed with a super-triangle.

One triangle engulfs the entire window on the outside

Given that the point does lie in a triangle’s circumcenter, the triangle is removed and its edges torn to form three new triangles with the point.

Three Triangles

Given the point is placed in the circumcenter of two or more triangles, the triangles are removed and overlapping aligning edges of the triangles are also removed.

Two Triangles

The remaining edges are unique and are used to construct new triangles with the point.

Four Triangles

Triangle edges are painted with the pixel color value at the center of the triangle.

The iteration continues until all points have been added to the mesh.

Check out the code available here.