Where it started: an intuition I couldn't explain
The first time I saw a Mondrian painting, I was a little puzzled. A few lines and some patches of red, yellow and blue: why did this matter so much?
I have a habit when I look at things: I ask what they remind me of. The longer I looked at those rectangles, the more they felt like a skeleton, like a magazine spread, the shelves of a shop window, the compartments of a bookcase. So I filed their character away in my head: straight lines, rectangles of very different sizes, one clear protagonist, empty space that never feels empty. And I kept wondering what everyday things could live inside a skeleton like that.
The thought sat there for a long time. Then I wanted to make a photo book with a magazine feel and real breathing room, and I couldn't find templates that felt alive. There were very few to choose from, most just divided the page into equal boxes, and the white space was either missing or awkwardly empty. Even the good ones ran out: a few spreads in, the same layouts started repeating. I realised I wasn't only looking for templates. I was looking for a source: something that could keep producing new layouts without end, each one different and each one still balanced, so I'd never run out of room to play. That old feeling came back: what if the photos moved into the boxes the painter had already drawn? I decided to try.
1. Turning a painting into a grid
Measure every rectangle in the painting and you get an uneven grid: some cells wide, some narrow, some square, some flat. The grid holds no content, only proportions, and the painter already spent years getting those proportions right.
The diagrams in this post use an example grid drawn for illustration.
2. Principle one: merge whole cells only
The painting's cells are too small and too many to hold photos directly, so they need to be merged. There is just one rule:
Neighbouring cells may be merged into a larger rectangle, but no cell may ever be cut.
Because of this, every block's edges fall on the painting's own lines, and every size comes from the painting's own proportions. Whatever merge you end up with, it inherits the painting's rhythm.
This constraint looks strict, but it is the heart of the method.
3. How many layouts can one painting make?
Under this rule, how many layouts can a painting with n cells produce?
A reference point. Start with regular grids, where every line runs edge to edge:
- a single row of n cells: each divider can stay or go, so 2n−1 ways;
- a regular 3×3 grid: 322 ways; a 4×4 grid: 70,878 (OEIS A182275).
My counting program reproduces these known values exactly, which is how I checked it before running it on the paintings.
The real numbers. A painting's cells are uneven and many of its lines stop short, so there are usually fewer ways to merge than in a regular grid. I counted every painting in my collection exactly, one page at a time, with the painting filling a square page:
| Cells | Ways to merge (one page) |
|---|---|
| 4–8 | 1 to about 150; half fall between 10 and 40 |
| 9–14 | a handful to about 4,500; typically around 150 |
| 15–19 | about 100 to about 100,000 |
| 20–35 | about 20,000 to about 118 billion; typically around ten million |
How many are pleasant to look at? For every painting small enough to list in full, I checked each layout against my own set of criteria:
- paintings with few cells: typically about 40% pass, from none to nearly a hundred layouts each;
- around a dozen cells: typically about 5% pass; about a third of these paintings give none, the best give well over a hundred;
- fifteen cells or more: usually well under 1% pass, yet the best still give a few hundred.
A few paintings produced nothing usable at all. Their cells were too fragmented, or nothing but long thin strips.
Then multiply. A spread has two pages. Each page can use a different painting, either one can be mirrored, and every block can be a photo, text or white space. Together, these combinations give even more variations.
So the problem was never a shortage of templates. It's how to pick the few good ones out of an ocean of combinations.
4. Principle two: assign roles, then score
Each block takes on a role: photo, text or white space. Then the whole spread is scored against a few plain intuitions:
- there is a clear lead and supporting cast;
- the size contrast is obvious;
- there are no slivers;
- the blocks' shapes suit the photos;
- the two pages carry roughly equal weight.
Each time, the system tries many random merges and keeps only the most comfortable one. Randomness brings variety; scoring protects quality.
5. What I noticed in practice
- Constraint produces better results. When blocks could be cut freely, layouts turned messy. The one rule of "whole cells only" made good results far more common.
- Paintings have personalities. Paintings with many cells suit photo-heavy pages; paintings with few cells give a more generous, open feel.
6. Limitations
To my eye, layouts grown from a painting's skeleton look far better than layouts from arbitrary rules, like random splits or equal grids. But that's only my feeling, not a measurement. My idea of "pleasant" is intuition, not tested with readers. The highest-scoring layout isn't always the one people like most, so in the end a human eye still has to choose. A natural next step is to learn from the layouts people actually save and favorite, and let that slowly teach what a well-loved page looks like.
If this idea interests you, whether you want to try it, push it further or simply tell me whether it matches your eye, I’d love to hear from you and talk it through.




Top comments (0)