source: pixel luminance → weighted Voronoi (Lloyd)

2D Stippling & Pointillism — Image-Driven Weighted Voronoi Relaxation

This simulator performs real weighted Voronoi stippling on a flat 2D canvas, driven by actual pixel luminance instead of an analytic formula. A source image — a built-in preset scene or a drawing you sketch yourself — is rasterised to an offscreen buffer and sampled with getImageData to build a density map. Points are seeded by rejection sampling from that map and then relaxed with Lloyd's algorithm: each iteration partitions the buffer into Voronoi cells around the current dots and nudges every dot toward the luminance-weighted centroid of its cell, so darker regions of the source end up densely packed with dots while lighter regions stay sparse. Tune the point count, dot size and contrast gamma, invert the tone mapping, or draw your own source image and watch it turn into stipple art in real time.