François Morellet Generator (JavaScript)
Posted by Al Sweigart in misc
In the New York Museum of Modern Art, there's a piece by Francois Morellet titled Random Distribution of 40,000 Squares Using the Odd and Even Numbers of a Telephone Directory. It's a 200 by 200 grid, and Morellet would have his wife or one of his sons read out numbers from the phone book as a source of random odd and even numbers, and he'd mark the grid so that he could later paint them red or blue. This was 1960, so he had to do it manually. (I always thought it odd that his wife and sons aren't included in the credits.) Here in the 21st century, I knocked out a Morellet Python package in 15 minutes to generate them in milliseconds. But I wanted a more accessible version, so using Claude Opus 4.6 I vibe coded a JavaScript version with a few more features.
You can download the generated images as PNG or SVG files. To optimize the SVG output, I directed the LLM to use some CSS tricks and run-length encoding to reduce the file size. (A 200 x 200 Morellet image produces a 1 MB SVG file. The equivalent PNG is about 100 KB and the WEBP is 6 KB. The theoretical uncompressed size is 40,000 bits or 5,000 bytes.)