Weighted Voronoi stippling: hundreds of points self-organise via Lloyd's relaxation algorithm driven by a density function, producing beautiful pointillist art. Select density patterns (waves, spiral, Mandelbrot, constellation), tune point count and dot size. Mathematical pointillism in the browser.

← Generative Art

Stippling & Pointillism

Points 500 Iter 0 UA
Info
Points500
Iteration0
ConvergedNo
Each dot moves to the weighted centroid of its Voronoi region every iteration — Lloyd's relaxation.
Pattern
Style
Points 500
Dot Size 1.0×

About this simulation

This simulation turns a chosen density function into pointillist art using weighted Voronoi stippling. Hundreds of dots are first scattered by rejection sampling, then repeatedly relaxed: every iteration each point drifts toward the density-weighted centroid of its Voronoi cell. This is Lloyd's algorithm, the same iteration behind k-means clustering. Over many steps the dots spread evenly through light areas and crowd into dark ones, reproducing tone with nothing but the spacing and size of individual dots.

🔬 What it shows

The canvas evaluates a density field on an 80×60 grid. Each grid cell is assigned to its nearest dot (Voronoi partition), and every dot moves 60% of the way toward the weighted mean of its cell, blended to prevent oscillation. The run is marked converged once the largest squared move falls below 0.5 pixels. Dot radius scales inversely with local density, so sparse regions get fewer, larger dots.

🎮 How to use

Pick a Pattern (Waves, Spiral, Mandelbrot or Stars) to change the underlying density field, and a Style (Mono, Sepia or Color) for the palette. The Points slider sets dot count from 100 to 900, and Dot Size scales the radius from 0.5× to 2.5×. Use Reset to re-seed, Pause/Resume to halt the loop, and Step to advance a single relaxation iteration.

💡 Did you know?

Weighted Voronoi stippling was introduced by Adrian Secord in 2002 as a way to recreate hand-drawn engraving and pen-and-ink shading automatically. The same centroidal Voronoi tessellation underlies blue-noise sampling used in rendering and even the spacing of cone cells in the retina.

Frequently asked questions

What is weighted Voronoi stippling?

It is a technique that represents tone and shape using only the position and size of small dots, with no continuous shading. A density function decides how many dots belong in each area, and the dots are arranged so that dark regions are densely packed while light regions stay sparse, mimicking traditional stipple and pointillist artwork.

How does the relaxation actually work?

Each iteration partitions the canvas so every grid sample belongs to its nearest dot, forming Voronoi cells. The simulation then computes the density-weighted centroid of each cell and nudges its dot 60% of the way toward that centroid. Repeating this is Lloyd's algorithm, which drives the points toward an evenly spaced, density-aware layout.

What do the Pattern buttons change?

They swap the density function that guides the dots. Waves uses interfering sine fields, Spiral applies a rotating arm with a radial falloff, Mandelbrot maps each point to the complex plane and shades by escape time, and Stars sums Gaussian blobs around twelve seeded cluster centres. Each gives a distinct distribution of light and dark.

Is the result mathematically accurate?

Yes within its model. The dot layout is a genuine centroidal Voronoi tessellation produced by Lloyd iteration, the same method used in scientific stippling and blue-noise sampling. For speed it samples density on an 80×60 grid and uses a spatial hash for nearest-neighbour search, so it approximates true continuous Voronoi regions rather than computing exact cell boundaries.

Why do dots stop moving after a while?

Lloyd's algorithm converges: as points settle near the centroids of their cells, the cells stabilise and further moves shrink. When the largest squared displacement in an iteration drops below 0.5 pixels the simulation flags the run as converged and stops relaxing, leaving a stable stipple pattern until you reset or change a control.