Uniform Random II
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jun 6, 2014
This example uses 10,000 uniform random samples to reconstruct Van Gogh’s *The Starry Night* as a Voronoi diagram. Each sample point becomes a cell, filled with the color sampled from the original image at that location. The code employs `d3.geom.voronoi` to compute the cells, the Canvas 2D API’s `getImageData` to extract pixel colors, and `d3.rgb` to format fill styles. The source image is drawn to canvas before sampling, and the result offers a stochastic, mosaic-like reinterpretation of the painting.
AI-generated description10,000 uniform random samples of Van Gogh’s The Starry Night. Compare to poisson-disc samples.
gpl-3.0 Licensed