How these palettes were sampled

Every hex code on this site's painting pages was measured from the artwork rather than picked by eye. This page documents exactly how, and — more usefully — what the numbers cannot tell you.

The source images

Images come from Wikimedia Commons. A painting is only included when its licence resolves to public domain and the artist is independently confirmed in the file's own metadata, not merely in a filename someone typed. Both checks are automated and a failure drops the entry from the build. Three candidates were dropped on the first run for exactly this reason, and works still in copyright — Hopper's Nighthawks, Wood's American Gothic — are excluded outright rather than reproduced under a guess.

Extraction

  1. The image is sampled at 700px on its long edge.
  2. Pixels are converted from sRGB into CIELAB, so that distance between two colours corresponds roughly to how different they look, rather than how different their RGB numbers happen to be.
  3. k-means clustering (k=26, fixed seed, so the build is reproducible).
  4. Clusters closer together than ΔE 5 are merged, so no two published swatches are colours a person would call the same colour.
  5. Each surviving cluster centroid is snapped to the nearest real pixel in the painting.

That last step is the one that matters most for honesty. A cluster centroid is an average, and the average of two pigments can easily be a colour the painter never mixed and that appears nowhere on the canvas. Snapping to a real pixel means every hex code published here is a colour that genuinely occurs in the work.

Which six colours get published

Publishing simply the six largest clusters produces technically defensible palettes that are wrong about the paintings. Sampled that way, The Starry Night returns six blues and no yellow at all — accurate to the surface, useless as a description of the picture. Monet's Impression, Sunrise loses its sun entirely.

So selection is split:

Accents are also picked with a hue-diversity penalty, so a painting built from a single hue family cannot spend every accent slot on near-identical swatches. That is what surfaces the blue headscarf in Girl with a Pearl Earring, which the warm golds around it would otherwise crowd out entirely.

What this cannot tell you

These are not the artist's colours. They are today's surface, photographed, and photographs of paintings vary considerably between sources in white balance and exposure. Varnish yellows. Pigments change. 6 of the 25 paintings here carry published conservation research showing measurable colour change since completion, and 7 list the pigments identified in them.

Where no such research exists, this site says nothing about pigments rather than guessing — an absent claim means absent evidence, not a stable painting.

For works involving metal leaf, such as Klimt's The Kiss, a hex code is a particularly rough instrument: gold changes with viewing angle and light in a way no flat colour value can hold.

Reproducing this

The pipeline lives in the site repository as scripts/build-dataset.py, scripts/choose_palette.py and scripts/gen-paintings.mjs. It is deterministic — same inputs, same hex codes.

← Back to the painting palettes

Looking for a combination we don’t have yet?

Tell us the colour, mood, or palette you were after — it shapes which editorial combinations we add next.