# Mondrian — Randomly

> Recursive subdivision, split at U(0.3, 0.7). One of 63 generators at [Randomly](https://randomly.cluxnei.dev), a library of random generators seeded from verifiable real-world entropy. Free HTTP API, no key, no signup.

## `images.mondrian` — Mondrian

Recursive subdivision, split at U(0.3, 0.7).

| | |
|---|---|
| **Key** | `images.mondrian` |
| **Module** | `images` |
| **Version** | `1` — a permalink carries this, and a replay against a different version returns `409` rather than something else |
| **Formats** | `application/json`, `text/plain`, `image/png` |
| **Studio** | https://randomly.cluxnei.dev/g/images/mondrian |
| **API** | `GET https://randomly.cluxnei.dev/api/v1/g/images.mondrian` |

`value` is a **render spec** — algorithm, parameters, palette and a render key — not pixels. Ask for `format=png` to get the image.

| Parameter | Type | Default | Accepts | What it does |
|---|---|---|---|---|
| `width` | int | `900` | `256` – `2048` | Width |
| `height` | int | `900` | `256` – `2048` | Height |
| `cut_min` | float | `0.3` | `0.02` – `0.5` | Cut range, low — Where along a rectangle a cut may fall. Push this to 0.02 and the composition shreds into slivers; push it to 0.5 and every cut lands in the middle, which is a grid. |
| `threshold` | float | `0.035` | `0.002` – `0.25` | Stop below — A rectangle smaller than this fraction of the canvas is left whole. The single strongest control over how busy the result is. |
| `squareness` | float | `0.78` | `0` – `1` | Cut the long side — How often a cut crosses the longer side. At 1 every rectangle is pushed towards square; at 0 the composition drifts into long bands. |
| `fill` | float | `0.34` | `0` – `1` | Painted cells — The fraction that get a colour rather than staying paper. Mondrian used very few, and a canvas that is mostly colour stops reading as a composition and starts reading as a quilt. |
| `stroke` | float | `9` | `0` – `30` | Line weight — The gutter between cells, in pixels. The lines are not drawn — they are the ground showing through. |
| `background` | enum | `ink` | `ink`, `ground`, `paper`, `palette` | Lines |
| `paper` | bool | `true` | `true`, `false` | Unpainted cells are white — Off, the unpainted cells take the palette's lightest stop instead, which keeps the whole composition inside one colour scheme. |
| `palette` | enum | `triadic` | `golden`, `analogous`, `complementary`, `triadic`, `split`, `viridis`, `magma`, `mono` | Colour |
| `colours` | int | `5` | `2` – `10` | Palette size |
| `grain` | float | `0.012` | `0` – `0.08` | Grain |

Out-of-range numbers are **clamped, not rejected**, so a request never fails for being
ambitious — but it may not do what you meant. Unknown keys are dropped and missing ones
fall back to the defaults above.

```bash
curl -s 'https://randomly.cluxnei.dev/api/v1/g/images.mondrian?width=900&height=900&cut_min=0.3' -H 'Accept: text/plain'
curl -o out.png 'https://randomly.cluxnei.dev/api/v1/g/images.mondrian?width=900&height=900&cut_min=0.3&format=png'
```

## The receipt

Every result carries one, naming the physical source of the randomness and linking to the
third party's own record of it:

```json
"receipt": {
  "source": "seismic",
  "source_label": "USGS Seismic Feed",
  "class": "C",
  "caveat": "Carries only tens of bits of genuine surprise. Always mixed with the OS CSPRNG.",
  "narrative": "A magnitude 3.6 earthquake, 67 km N of Culebra, Puerto Rico, 39.6 km down — 52 minutes ago.",
  "proof_url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000th33",
  "mixed_with_csprng": true,
  "degraded": false
}
```

Pick the source with `?source=`, or leave it at the default `auto`:

- **Class A** (Cryptographic) — `csprng`, `anu-qrng`, `random-org`
- **Class B** (Public beacon) — `nist-beacon`, `drand`, `bitcoin`. Published openly — anyone can look this value up after the fact.
- **Class C** (Observational) — `seismic`, `space-weather`, `atmosphere`, `iss`. Carries only tens of bits of genuine surprise. Always mixed with the OS CSPRNG.

## More

- [The full API contract](https://randomly.cluxnei.dev/api.md)
- [Everything in one file](https://randomly.cluxnei.dev/llms-full.txt)
- [The catalogue as JSON](https://randomly.cluxnei.dev/api/v1/generators)
- [This generator in the browser](https://randomly.cluxnei.dev/g/images/mondrian)
