Mondrian Art Generator
Generate authentic Piet Mondrian-style abstract art using recursive binary space partitioning. Export high-res PNG compositions with customizable grids and palettes.
About
Piet Mondrian's neoplastic compositions follow strict geometric rules: orthogonal black lines partition a plane into rectangles filled with primary colors (red #C0392B, blue #2471A3, yellow #F4D03F) and non-colors (white, grey, black). Replicating this by hand requires balancing asymmetry against visual weight - a rectangle's perceived mass scales with its area A multiplied by the color's saturation. This generator uses recursive binary space partitioning to subdivide a canvas, then applies Mondrian's empirical color distribution: approximately 55% white, 12% red, 12% blue, 10% yellow, 6% black, 5% grey. Line thickness defaults to 6px relative to a 800px canvas, matching the proportions in "Composition with Red, Blue, and Yellow" (1930). The tool approximates Mondrian's aesthetic heuristics. It does not model his later "Broadway Boogie Woogie" period, which abandoned thick black lines.
Formulas
The generator recursively subdivides a rectangle using binary space partitioning. At each recursion level d, the probability of splitting is:
where Pbase ≈ 0.95 and decay ≈ 0.85. Splitting stops when the cell dimension falls below a minimum size Smin. The split position t along the chosen axis is sampled uniformly from the range:
where L is the length of the axis being split. The axis choice is biased by aspect ratio: if w > h, vertical split probability increases proportionally to ww + h. Color assignment uses a weighted discrete distribution with cumulative probability thresholds.
The seeded PRNG uses the Mulberry32 algorithm:
where s is the mutable state seeded from user input, and ⊕ denotes bitwise XOR. Output is normalized to [0, 1).
Reference Data
| Painting | Year | Dominant Colors | Grid Complexity | Line Weight | Largest Rectangle % |
|---|---|---|---|---|---|
| Composition II in Red, Blue, and Yellow | 1930 | Red, Blue, Yellow, White | Low (9 cells) | Thick | ~35% |
| Composition with Large Red Plane | 1921 | Red, Yellow, Blue, White, Grey | Medium (12 cells) | Medium | ~40% |
| Tableau I | 1921 | Red, Blue, Yellow, Black, White | High (16 cells) | Thick | ~25% |
| Composition No. III | 1929 | Red, Yellow, White | Low (7 cells) | Thick | ~45% |
| Composition A | 1923 | Red, Blue, Yellow, Grey, White | Medium (14 cells) | Medium | ~20% |
| Composition with Yellow, Blue, and Red | 1937 | Yellow, Blue, Red, White | Low (8 cells) | Thick | ~50% |
| Composition No. 10 | 1939 | White, Black lines only | High (20+ cells) | Thin-Medium | ~15% |
| Broadway Boogie Woogie | 1943 | Yellow, Red, Blue, Grey | Very High (100+) | No black lines | ~5% |
| Composition with Red | 1936 | Red, White | Low (6 cells) | Thick | ~60% |
| Lozenge Composition | 1925 | Red, White, Yellow | Medium (10 cells) | Thick | ~30% |
| Composition London | 1940 | Red, Blue, Yellow, White | Medium (13 cells) | Medium | ~22% |
| Victory Boogie Woogie | 1944 | Yellow, Red, Blue, Grey | Very High | No black lines | ~3% |