Generating Pretty Images
This post works best on desktop.
A long time ago at a CSC Code Party I wrote this thing that generated pretty images. It’s running in the background of this webpage.
I like to watch it. It reminds me of geography, or maps. And the colors!
Why is it so slow? At 1080p, it takes twenty seconds to complete a cycle of 100 paints on my M1 Pro. What does this algorithm do?
How do these images get generated?
- Run a random walk across the grid.
- Pick a random spot on the grid
-
From there, BFS locations not visited by the random walk.
- If we visit at least a fiftieth of the total area of the of the grid, we paint that this section.
- If we haven't, we try one more time.