delaunify
Randomly delaunay-triangulates an image by distributing 2D points across the surface, and then triangulating it. The colours of each triangle is determined by the pixel color underneath the triangle's centroid.
A new canvas is returned with the same size as the image.
var load = var domready = var uri = var delaunify =
Usage
delaunify(img[, opts])
Triangulates the image. By default, it uses a random distribution of points.
Options:
min
an [x,y] array for the minimum random value (default[0, 0]
)max
an [x,y] array for the maximum random value (default[imgWidth, imgHeight]
)count
the number of points to distribute (default50
)fill
a boolean, whether to apply a fill (defaulttrue
)stroke
a boolean, whether to apply a stroke (defaulttrue
)points
an array of [x,y] points to use instead of random; this will ignore themin
,max
andcount
options
License
MIT, see LICENSE.md for details.