Metamer Atlas
Sample the metamer polytope and map where its shape changes across color space.
The problem
A color does not pin down a spectrum. Infinitely many physical reflectances produce the same tristimulus under a given illuminant, and the set of all such matches is a convex polytope, an affine slice of the unit box in 38-dimensional spectral space. The shape of that polytope is not constant across color space: near the achromatic axis it is roomy, and approaching the object-color solid boundary it collapses onto faces and finally to a single point, but nothing in the literature maps where those regime changes happen.
The method
Both tools build on the convex-geometry framework of Logvinenko (2009) and Godau and Funt (2010): the metamer set for target tristimulus b is M(b) = { r in [0,1]^38 : Ar = b }, where A is the 3x38 colorimetric operator. sample_metamers finds a feasible center by projection with box correction, then line-searches along seeded null-space directions to the box boundary; the search stays inside the affine slice, so every returned spectrum matches the target exactly by construction, and the tool returns the center, boundary samples, and a per-wavelength envelope. map_metamer_stratification probes points along a path through color space, counts which box constraints (r_i = 0 or r_i = 1) are pinned on every sampled boundary point, measures free extent along null-space directions, and classifies each probe as interior, faceted, near-optimal, degenerate, or outside, with detected transitions between strata. This is a sampled, empirical stratification measured over null-space directions, not exact face-lattice enumeration.
What it promises
- Boundary samples match the target color exactly by construction: the line search never leaves the affine slice.
- Unrealizable targets fail loudly with NO_SOLUTION instead of returning a best-effort spectrum.
- The stratification is sampled, not exact face-lattice enumeration; the tool description states this and the caveat must not be stripped.
- Every response carries engine_version and dataset_snapshot metadata for reproducibility.
Calling it
{
"tool": "map_metamer_stratification",
"arguments": {
"illuminant": "D65",
"path": "neutral_ramp",
"steps": 8,
"samples": 10,
"seed": 42
}
} Clone the repo, then cd mcp && npm install && npm run build, then register: claude mcp add maryslab -- node mcp/dist/server.js
Known limits
- Sampled stratification only: active-constraint counts and free extent are measured over seeded null-space directions, and stratum labels come from thresholded statistics, not an exact face lattice.
- All results are relative to the canonical 38-sample grid (380 to 750 nm at 10 nm) and the stated illuminant and observer.
- Novelty was established by absence in a literature sweep; whether the map is useful in practice has not been demonstrated.