GrainGenerative Art Engine
What it does for you
A seedable print studio with three drawing systems and portable artwork recipes.

Screenshots

In more detail
Grain is a small print studio where a few rules generate abstract artwork you can come back to. There are three drawing systems: flowing lines, layered orbit shapes, and tiled arcs. Type a seed, pick a palette, adjust a few controls, and the same inputs always give you the same picture, so a good result never disappears on the next click.
Honest limits
The renderer is synchronous, with complexity kept bounded so it does not freeze. The geometry is deterministic, but antialiasing can vary between browser versions, so pixels may not match exactly from one browser to the next. There is no animation timeline, no vector editor, and no public gallery. Browser checks covered all three systems, random seed changes, safe titles, both themes, and mobile overflow, and I reviewed both desktop themes and the mobile screenshot. Codex built it in about 0.16 hours, so it is a finished sketch, not a hammered product.
How I built it
Codex built this on September 23 as part of its list in the split file. It wrote the deterministic drawing systems, the controls, undo history, a shelf that holds 12 studies, the export paths, and the verification. I set the creative scope, the polish bar, and a local-only boundary. No image model and no outside imagery were used. Everything is drawn from code.
The key design choice: seeded randomness produces the geometry before any rendering happens. The same points then go to the screen on Canvas, or out as a vector SVG or a 2x PNG. Changing the palette recolors the piece without moving a single point. Each study saves as a portable JSON recipe with every control and the focal point in it.
What I learned
- Adding raw angles creates a visible seam where the angle math wraps around. Codex replaced that with a sum of direction vectors, and the breaks in the flow lines went away.
- A recipe beats a screenshot for picking up where you left off. If a setting is not in the recipe, you cannot get back to the piece.
- Looking at the screenshots caught something tests did not: the canvas went blank during a theme change even though its pixels were correct underneath. Repainting after the style update fixed it.
- Pixel-identical undo and recipe restore turned out to be a clean test for reproducibility. If restoring a recipe gives you the exact same pixels, the engine is deterministic.
What carried forward
The split between "compute it" and "draw it" is the same shape as the first-week pattern, where one pure module is shared by the page and the tests. Here the geometry module feeds Canvas, SVG, and the checks alike. It also follows the shared build rules every builder worked under: serve.mjs on port 5189, ?demo=1, both themes, and a LOG-ENTRY.json for Claude Code to check and merge. Seeds as the source of truth show up again in #90, where the dice live inside the game state.
If I took it further
I would move bigger compositions into a worker and add path simplification for pen plotters. I would also save the recipe and the engine version beside every export, so any print can be made again.
#089 Built with Codex September 23, 2026 35 automated checks