Voronoi Diagram Generator

Generate Voronoi diagrams in your browser. Control cell density, seed drift, border thickness and colour, then export a PNG. Runs as a fragment shader on the GPU.

Voronoi Cells

Live controls

6
1
0.4
0.06
190
90
1

Knobs patch the running animation live. A few (marked in the code as baked-in values like particle counts) restart the preview.

Nearest-seed cells from a 3×3 neighbour search, drifting live.

Your code runs in a sandboxed frame with no access to this page, and it is never sent to a server. three.js demos load the library from jsDelivr; the rest need nothing but the browser.

Pick an animation

All 40 animations →

Canvas 2D
three.js
WebGL
CSS / DOM
Advertisement

What a Voronoi diagram is

Scatter points across a plane, then colour every position according to which point it is nearest. The result partitions the plane into one cell per seed, with borders lying exactly halfway between neighbouring seeds. That single rule produces the cracked, organic look that turns up in giraffe markings, dried mud, foam and cell tissue.

The same structure answers nearest-facility questions directly. Draw a Voronoi diagram over a map of hospitals and each cell is the region for which that hospital is the closest one.

Computed per pixel on the GPU

Rather than computing the diagram as geometry, this generator solves it per pixel in a fragment shader. Space is divided into a grid with one seed per grid square, and each pixel checks its own square and the eight around it for the nearest seed.

Searching a three by three neighbourhood is not an approximation for this arrangement: with one seed per cell, no seed outside those nine squares can be closer than the nearest one inside them. That bound is what keeps the whole diagram cheap enough to animate while the seeds drift.

Frequently Asked Questions

What is a Voronoi diagram?+

A division of a plane into cells, one per seed point, where every position belongs to the cell of the seed it is closest to. The borders sit exactly halfway between neighbouring seeds.

How is it generated here?+

As a fragment shader on the GPU. Each pixel searches its own cell and the eight surrounding ones for the nearest seed, which is enough to get the correct answer while staying fast enough to animate.

Can I export the result?+

Yes, as a PNG at the size shown.

What are Voronoi patterns used for?+

Procedural textures for stone, scales, cracked earth and foam; mesh generation; and any nearest-facility problem such as which shop, cell tower or hospital is closest to a given point.

Can I stop the cells moving?+

Yes. Set seed drift to zero for a static diagram, or raise it for a slowly shifting pattern.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.
Voronoi Diagram Generator - Free Online Cell Pattern Maker | InventiveHQ