Repository navigation
Releases
v1.0: the Lab
The first full release of Palette Atlas: the Lab joins the Studio and the Atlas, and the code is now open source. Live at itzik123.github.io/PaletteAtlas.
Everything still runs in your browser; your images never leave your computer.
What's new
- The Lab: the very search that found an image's paintings, replayed down the five layers of the index. Every painting is a dot of its own color on a map of the gallery, a magnifier follows the search across the bottom layer, and the 10 nearest it found are checked against measuring every painting. Every wall of matches leads there by "How they were found".
- Keyboard and screen readers: whatever a pointer does, a keyboard does too. The Studio's strip and a Career Barcode step stripe by stripe and bar by bar, a painting's picture enlarges with Enter, and every page passes axe-core's WCAG 2.2 AA checks, on laptops and phones. Where the system asks for less motion, the Lab opens still, on the search's end.
- Faster loading: on a slow phone connection, a painting's picture arrives in 5.6 s rather than 11.5, its page downloading 1.6 MB rather than 9.2, and a wall of matches shows its first screen in 17 s rather than 83.
- Phones: every page and state checked from 320 to 430 px wide, upright and on its side, and on a tablet.
- Open source: the code under the MIT License, and a GIF of each part in the README.
Under the hood
- The search trace: the index reports every step a search takes to a tracer, which the Atlas's searches leave silent at no cost; the Lab records one and replays it.
- Landmarks on the top layer: every search now starts among the most typical paintings of 8 color families, rather than 2 drawn at random, at the same cost and with the same answers.
- The paintings' map: the two directions in which the paintings' color schemes differ most (92.5% of the variance), on which the Lab places every painting and a visitor's image.
- Each painting's nearest, stored: the pipeline writes each painting's first 60 matches, so its page needs no search index, and the gallery comes in chunks of 100 paintings rather than 1,000.
- Faster palettes: k-means keeps bounds on each pixel's distances to the palette (Hamerly, 2010), reading the same palettes in half the time; the Lab draws a replay frame in a quarter of the time.
Credits
The paintings are catalogued by Wikidata, and their images come from Wikimedia Commons, every one marked public domain or CC0 there; each painting's page credits its artist, title, date and collection. The Studio's samples are the Mona Lisa (Louvre, by way of Wikimedia Commons) and three CC0 works from the Art Institute of Chicago. The ray-traced renders in benchmark/ and the README's GIFs are under CC BY 4.0.
v0.2: the Atlas
The second release of Palette Atlas: the Atlas, a gallery of 48,695 public-domain paintings, and a search for the paintings in any image's colors. Live at palette-atlas.pages.dev.
Everything still runs in your browser; your images never leave your computer.
What's new
- The Atlas: 48,695 public-domain paintings on one wall, the most famous first, each at its own shape over its color strip, with a museum label on hover. Coming back from a painting returns to the same place on the wall.
- A page for every painting: the picture on a card, enlarged in a museum frame on a click, its details and credit, and its strips read four ways, all on one screen.
- Career Barcodes: the careers of 8,373 painters, each as a barcode with one bar per painting, oldest first, and a list of every painter that forgives typos.
- Search by color: drop, paste or pick any image on the Atlas, or send one from the Studio, to see the 600 paintings nearest its colors. Every painting's page shows the paintings in its own colors.
- Polish: the Studio fits a desktop window without scrolling, and the Atlas is laid out for phones.
Under the hood
- A data pipeline: Python chooses the paintings on Wikidata and checks every file's license on Wikimedia Commons; Node reads their strips with the same code the browser runs.
- Color schemes as vectors: each painting's color strip becomes 128 numbers (a sliced Wasserstein embedding), and the distance between two of them tracks the Earth Mover's Distance between their color schemes.
- HNSW, written from scratch: it finds the true 10 nearest paintings out of 48,695 in about a quarter of a millisecond, checked against brute force, and every search can record its steps for the coming Lab to replay.
- A compact index: the graph and the vectors in one binary file, a byte per number, gzipped to 5.4 MB. A Web Worker reads it once and answers each search in about a millisecond.
Credits
The Atlas's paintings are catalogued by Wikidata, and their images come from Wikimedia Commons, every one marked public domain or CC0 there; each painting's page credits its artist, title, date and collection.
v0.1: the Studio
The first release of Palette Atlas: the Studio, live at palette-atlas.pages.dev.
Turn any image into a strip of color. Everything runs in your browser; your images never leave your computer.
What's in it
- Any image in: drag and drop anywhere on the page, choose a file, paste, or pick one of four famous public-domain paintings from the sample wall (the Mona Lisa, A Sunday on La Grande Jatte, The Bedroom, The Great Wave), each hung in a flat version of its museum's frame.
- Four ways to read it: by color (the image's palette along its shortest path), along a Hilbert curve, in columns, or in rings from the center out. Each strip has 128 stripes, every one the true average light of its pixels.
- Hover linking: point at a stripe to uncover the pixels it came from; point at the picture to pin the stripe a pixel went into. Works by touch on phones.
- Export: save the strip as a 2400 × 3600 poster, framed and captioned, or as a phone wallpaper.
- Never freezes: decoding and reading run in a Web Worker, and every failure ends in a clear message.
- A bold, poster-like look: cream paper, ink outlines, hard shadows and big heavy type, on desktop and phone alike.
Under the hood
- A color library: averaging in linear light, OKLab, k-means palettes that grow until they cover their image, and palette ordering by an exact TSP (Held-Karp).
- A strip engine in which every stripe remembers its source pixels, with a Hilbert curve for images of any shape.
- The same code draws the strips in the browser and in Node: UI tests check the browser's strips against the pipeline's reference strips pixel for pixel, and they match in Chromium, Firefox and WebKit.
- Every green push to
maindeploys to Cloudflare Pages from CI.
Credits
The sample paintings are in the public domain: the Mona Lisa (Louvre) by way of Wikimedia Commons, and A Sunday on La Grande Jatte, The Bedroom and The Great Wave courtesy of the Art Institute of Chicago (CC0).