StainedGlass

The church has no more exclusivity on them.

Apply StainedGlass to a picture

new StainedGlass(document.getElementById('example-1'));

Add more/less granularity

new StainedGlass(document.getElementById('example-2'), {
  polygons: 300 // default: 100
});

Photo by the awesome Eyal Levkovich

Play with regularity

new StainedGlass(document.getElementById('example-3'), {
  deviation: 0 // default: 0.2
});

Add borders

new StainedGlass(document.getElementById('example-4'), {
  stroke: 'black', // uses the color of the shaped by default
  strokeWidth: 3 // default: 1.52
});

Triangles

new StainedGlass(document.getElementById('example-5'), {
  triangles: true
});

Animate

new StainedGlass(document.getElementById('example-6'), {
  polygons: 500,
  triangles: true,
  animated: true
});

Follow the cursor

new StainedGlass(document.getElementById('example-7), {
  polygons: 500,
  triangles: true,
  animated: true,
  animationDuration: 300,
  followCursor: true
});


Requires d3.js

@davinov, from Toucan Toco

Inspired by Trianglify