RGB palettes

Keep the three color channels together

Early interpolation took 3.131 s against a 0.678 s reference workflow on the same photo. Using joint RGB errors reduced that to 0.400 s, 1.70× as fast as the reference.

What slowed down

The initial target summary used general-purpose PCA interpolation. In the matched rerun it needed far more work than first solving on color-bin centers and then checking and refining on the original colors. Both workflows returned a mean destination color for each source and the transport cost, not the full transport matrix.

What changed mathematically

Bounding R, G and B separately can count a large red error, a large green error and a large blue error as if they occurred on the same color. We bounded the mixed interpolation terms with joint residual moments, such as averages of |eR|ᵖ |eG|ᑫ |eB|ʳ, and used only the channel differences that an actual pair of palette colors can make together. This tightened the error bound and let us use fewer representative colors. In the same new code, enabling the joint information reduced the node count by 33% and 43%, and total time by 19% and 18%.

Matched results

Seconds for 32 palettes per photo, including preparation; five single-thread trials, median. Both methods used the same targets for plan TV and the returned quantities. Independent comparisons with a tighter solve on the original colors found a maximum plan TV discrepancy of 0.000111.

PhotoFastest referenceEarly PCANew, channel-wiseNew, joint
Landscape0.6783.1310.4950.400
Flowers0.4252.3600.3830.313

The strongest reference in this experiment was a custom Sinkhorn workflow, not an unmodified POT call. The joint RGB summary is a separate research implementation. In the dense POT integration, the full-plan RGB benchmark is a different comparison and does not use this summary.

Timing data · Accuracy checks · Photo source