top | item 9410684

(no title)

d55 | 11 years ago

I failed in doing something very similar. Could you explain how you split the image up into triangles?

discuss

order

metaphorical|11 years ago

Yes. I use d3.geom.delaunay or d3.geom.voronoi to create the delaunay or voronoi tessellation.

http://bl.ocks.org/mbostock/4341156

Then for each polygon, I take its points (center point or vertices or an arbitrary point) and find the corresponding pixel on the image. Then I extract the rgb color, and use that to fill the polygon (as solid color or gradient).