Color Distance Oracle (CDO) Overview
- CDO preprocesses colored data to efficiently query the minimal cross-color distances, balancing metric structures with perceptual fidelity.
- In array-metric settings, CDO achieves optimal tradeoffs between preprocessing and query time with both exact and (1+ε)-approximate methods.
- Practical CDOs leverage Euclidean embeddings and semantic cues to enable robust image-level color comparisons and effective palette design.
A Color Distance Oracle (CDO) is a query-oriented mechanism for returning distances between color classes, color samples, or color-bearing signals after preprocessing. In the fine-grained data-structure sense, a CDO preprocesses a set of points with associated colors so that, given two colors and , it returns the closest cross-color pair distance
where is the set of points of color (Horowicz et al., 6 Jul 2025). In color science and imaging, the same phrase is used operationally for systems that embed colors, patches, or images into spaces where perceptually meaningful queries—nearest color, bounded color difference, or image-level color discrepancy—can be answered efficiently (Uchida, 3 Jun 2026). Across these usages, the central design problem is the same: how to balance perceptual fidelity, metric structure, and query efficiency.
1. Problem scope and principal regimes
In the literature considered here, CDO refers not to a single formula but to a family of oracle constructions whose query object ranges from colored points in an array to perceptual embeddings of colors and photographic images (Horowicz et al., 6 Jul 2025).
| Regime | Oracle object | Representative output |
|---|---|---|
| Array-metric CDO | Colored points in a metric space | or a closest witness pair |
| Perceptual point-color CDO | Embedded colors or palette entries | nearest neighbor or transformed-space |
| Image-level CDO | Photographic image pairs or patch distributions | perceptual color-difference score |
The formal array setting is the most rigid. Let be a metric space with distance , let be a set of 0 points, and let each point 1 have a color 2. The CDO query asks for 3, while the 4-approximate version asks for 5 such that
6
This is the setting in which the strongest exact-versus-approximate complexity separation is known (Horowicz et al., 6 Jul 2025).
The perceptual setting is broader. In Oklch+, the relevant oracle is a transformed metric embedding: colors are mapped into transformed 7 coordinates and ordinary Euclidean nearest-neighbor machinery is then used directly (Uchida, 3 Jun 2026). In semantic or image-level systems, the oracle may instead combine thresholded colorimetric distances with Earth Mover’s Distance over color-name descriptors, or compare multiscale patch distributions under sliced Wasserstein distance (Pele et al., 2012, He et al., 2024). This suggests that CDO is best understood as an interface: preprocess once, answer many perceptually meaningful distance queries later.
2. Exact and approximate CDO in the array metric
The most precise theoretical treatment appears in the array metric, where 8 and 9 (Horowicz et al., 6 Jul 2025). This setting is closely linked to the snippets problem studied by Kopelowitz and Krauthgamer, in which a preprocessed text must answer closest-occurrence queries for two patterns. The reduction uses suffix-tree colors and yields a multi-color distance-oracle instance, so improvements and lower bounds for CDO transfer to snippets.
For exact CDO, Kopelowitz and Krauthgamer gave a tradeoff
0
preprocessing and
1
query time, which corresponds to the curve 2 when preprocessing is 3 and query time is 4. The newer lower bound shows that, assuming the Strong-APSP hypothesis for randomized algorithms, any exact CDO on 5 points in an array of size 6 with preprocessing time 7 and query time 8 must satisfy
9
Accordingly, the earlier exact tradeoff is essentially optimal (Horowicz et al., 6 Jul 2025).
Approximation is strictly easier. For 0-approximate CDO, the oracle uses fast matrix multiplication and attains the tradeoff
1
2
where 3 is the square matrix multiplication exponent (Horowicz et al., 6 Jul 2025). Under the idealized assumption 4, this becomes
5
6
The point 7 is the knee of this curve. At 8, for example, approximate CDO can use 9, whereas exact CDO still requires 0 (Horowicz et al., 6 Jul 2025).
This exact-versus-approximate separation is the central theoretical result. A common misconception is that approximation merely improves constants. In the array metric, it changes the achievable exponent tradeoff itself. Another misconception is that this resolves CDO complexity in general. The paper is explicit that the positive and negative results are for points in an array; extending improved algorithms beyond arrays, most notably to higher-dimensional Euclidean spaces or more general metrics, remains open (Horowicz et al., 6 Jul 2025).
3. Euclidean perceptual embeddings as practical CDOs
In practical color retrieval, the most attractive oracle is often one that reduces perceptual comparison to ordinary 1 search after a fixed embedding. Oklch+ is an explicit example. It is presented not as a wholly new foundational color space in the same sense as Oklab, nor as a standalone non-Euclidean distance formula like CIEDE2000, but as a transformed metric space built on Oklab/Oklch coordinates (Uchida, 3 Jun 2026).
Starting from Oklch coordinates,
2
the model applies
3
reconstructs
4
and then computes
5
The jointly optimized parameters are
6
The lightness transform is a power law, while the chroma transform is a Naka–Rushton compression bounded in 7, preserving the achromatic point exactly since 8 (Uchida, 3 Jun 2026).
For a practical CDO, the decisive property is Euclidean-after-transform structure. Once colors are embedded into transformed 9, nearest-neighbor search can use KD-trees, ball trees, VP-trees, product quantization, HNSW, or GPU batched 0 search with no special-case metric implementation. That is a major systems advantage over CIEDE2000, whose pairwise formula is more complex and not an ordinary Euclidean norm in any coordinate system supplied by the standard formula (Uchida, 3 Jun 2026).
The empirical motivation is equally strong. On COMBVD, a composite benchmark of six suprathreshold color-difference datasets totaling 3,813 pairs, the reported STRESS values are:
- Oklab: 1
- Power-LC baseline: 2
- Oklch+: 3
- CIEDE2000: 4
Held-out validation on BFD-P D65 gives Oklab 5, Oklch+ 6, and CIEDE2000 7 (Uchida, 3 Jun 2026). The practical conclusion is not that Oklch+ broadly supersedes CIEDE2000, but that it nearly matches CIEDE2000 on the reported benchmark while retaining a simple transformed Euclidean geometry.
The limitations are explicit. The evaluation is centered on COMBVD, and 8 of pairs have 9 in Oklch, so the fitted model is overwhelmingly constrained by low-to-mid chroma data. Validation in high-chroma regions with empirical observer-rated discrimination data remains future work (Uchida, 3 Jun 2026). For CDO design, this means Oklch+ is especially attractive in sRGB-centered digital workflows, palette search, UI design, and perceptual interpolation, but it is not yet a universal replacement for conservative colorimetric practice.
4. Semantic, bounded, and category-aware color oracles
A different CDO strategy is to combine a standard small-difference colorimetric term with a semantic or categorical distance that behaves sensibly for medium and large differences. The COL distance does this explicitly by combining thresholded CIEDE2000 with Earth Mover’s Distance on 11-dimensional basic color-term probability vectors (Pele et al., 2012).
For two colors with CIELAB coordinates 0 and basic color-term distributions 1, COL defines
2
3
4
and
5
The paper uses
6
and estimates the 7 ground-distance matrix 8 from the overlap structure of the basic color naming model (Pele et al., 2012). The result is a bounded distance in 9 that saturates large differences, reduces the effect of very small differences, and can alter medium-range rankings that thresholding alone cannot fix.
This family was extended to image quality assessment in PCDM, which combines CIEDE2000 and perceptual color naming descriptors to assess full-image quality (Temel et al., 2018). The method extends CIEDE2000 with perceptual color difference, computes local color-based discrepancies after heavy downsampling, and averages the resulting distortion map. On the LIVE database, it reports compatible linear correlation under white noise (0), JPEG (1), and JPEG2000 (2), with an overall correlation of 3, and explicitly captures color-based artifacts that cannot be captured by structure-based metrics (Temel et al., 2018).
The broader implication is that not all useful CDOs are Euclidean embeddings. Some are intentionally bounded and semantically enriched. These are particularly relevant when the query semantics are “are these colors perceptually or categorically close?” rather than “can these items be indexed by an 4 data structure?” They are also useful when the just noticeable difference regime is too narrow, because they model saturation of large differences and semantic relationships among color categories directly (Pele et al., 2012).
5. Image-level and distributional CDOs for photographic images
When the oracle must compare photographic images rather than isolated colors, co-located pixel comparison becomes inadequate, especially under mild misalignment. Two distinct responses appear in the literature: training-free distributional comparison and learned metric embeddings.
MS-SWD defines a perceptual color-difference measure based on multiscale sliced Wasserstein distance between overlapping CIELAB patch distributions (He et al., 2024). For images 5 and 6, the final score is
7
and, with Monte Carlo approximation,
8
The implementation uses Gaussian pyramids, conversion from sRGB to CIELAB, 9 overlapping patches, and rank-based 1D Wasserstein comparisons after random projections. On SPCD non-perfectly aligned pairs, MS-SWD reports STRESS 0, PLCC 1, and SRCC 2, and the paper states that it consistently surpasses competing models in the presence of image misalignment (He et al., 2024). It is training-free, easy to implement, and empirically metric-like, although the paper does not provide a formal proof that it is a metric for fixed hyperparameters (He et al., 2024).
CD-Flow addresses the same domain through a learned multi-scale autoregressive normalizing flow, followed by Euclidean distance in the latent space (Chen et al., 2023). Its core distance is
3
The design goal is to obtain four properties simultaneously: linkage of color and form, metric validity, accuracy on photographic image pairs, and robustness to mild geometric distortions. On SPCD, CD-Flow reports STRESS 4, PLCC 5, and SRCC 6 on all pairs, and STRESS 7, PLCC 8, and SRCC 9 on non-perfectly aligned pairs (Chen et al., 2023). Unlike classical patch metrics, it is trained directly on same-content photographic image pairs with human perceptual color-difference labels.
A third direction, SL2D, is not a strict metric but a distribution alignment engine for colour grading (Alghamdi et al., 2021). It learns slice-wise one-dimensional mappings by minimizing
0
after projection, and is best viewed as a registration-based distance-and-map estimator rather than a canonical CDO metric (Alghamdi et al., 2021).
These image-level systems also clarify the limits of the term. They are strongest when two images depict the same or nearly the same content with differing color appearances. They are not general replacements for classical chip-level tolerancing, nor are they unrestricted semantic image-similarity measures. A common misconception is that a high-performing image-level color oracle should also dominate on perfectly aligned patch datasets. The reported results do not support that view: classical formulas remain very strong on aligned patch-like settings, while the newer methods earn their advantage under natural-scene complexity and misalignment (He et al., 2024, Chen et al., 2023).
6. Local ordering, palette design, and open limitations
CDO ideas also appear in neighborhood ordering and palette construction. In colour morphology, the DLES method computes a local reference colour via the log-exp-supremum of 1 symmetric matrices representing colours, then ranks the original neighbourhood colours by their distance to that reference, and finally resolves ties lexicographically by modified luminance, chroma, and hue (Kahra et al., 14 Mar 2025). The aim is to identify the original colour within the structuring element that most closely resembles a supremum, while avoiding the false-colour problem because the output is always chosen from the original colours in the neighbourhood. The experimentally preferred distances are 2 and 3, while 4 is reported as unsatisfactory in the tested morphological tasks (Kahra et al., 14 Mar 2025).
In visualization, the Equilibrium Distribution Model treats color selection as a maximin spacing problem in CIELAB (Maji et al., 2022). Its objective is to derive evenly distributed points in the CIELAB color space so that the minimum Euclidean Distance among the colors is optimized, using the analogy of charged particles on a sphere centered at mid-gray. The paper reports that the harmonic scheme can achieve reasonable color contrast for visualizing up to 20 different features, whereas the equilibrium scheme remains significantly above the just noticeable difference even at 100 unique features (Maji et al., 2022). For a CDO, this is the inverse problem of retrieval: not “which stored color is closest?” but “how should colors be placed so that nearest conflicts are maximally separated?”
Local filtering studies point in the same direction. In reduced-ordering vector filters for color denoising, the distance function itself is the oracle that determines centrality, outlier status, and the selected representative pixel. The comparative study finds that hybrid and fuzzy similarity-based oracles outperform the standard Minkowski defaults, with 5 best overall, 6 the strongest pure-color hybrid, 7 the best speed/quality tradeoff, and 8 superior to 9 as a simple classical baseline (Celebi, 2010). This reinforces a general lesson: the best CDO often depends on whether the task privileges metric legality, spatial context, semantic category structure, or retrieval-system efficiency.
No single CDO presently spans all settings. Oklch+ is compelling because it preserves Euclidean geometry after transform, but its empirical validation is predominantly low-to-mid chroma and sRGB-centered (Uchida, 3 Jun 2026). MS-SWD is robust on misaligned smartphone photography, but its metric behavior is empirically verified rather than formally proved (He et al., 2024). CD-Flow supplies a learned Euclidean latent metric, yet its strongest claims are confined to same-content photographic pairs (Chen et al., 2023). In fine-grained complexity, exact and approximate CDO are now sharply separated on arrays, but extending the improved approximate tradeoffs beyond one-dimensional metrics remains open (Horowicz et al., 6 Jul 2025).
Taken together, the literature presents CDO as a unifying query model rather than a single algorithmic object. In the strict data-structure formulation, it is a preprocessing/query problem over colored points. In perceptual color science, it is an engineered oracle that makes color distance operational for search, interpolation, palette design, morphology, or photographic comparison. The common structure is stable: preprocess a color-bearing domain, define a metric or pseudo-metric geometry suited to the task, and expose fast queries whose answers preserve as much perceptual or combinatorial meaning as possible.