Expand description
XYB color space roundtrip for fair metric comparison.
When comparing compressed images to originals, the original can first be roundtripped through XYB color space with u8 quantization to simulate what happens when a codec stores XYB values at 8-bit precision.
This isolates true compression error from color space conversion error, which is important when evaluating codecs that operate in XYB color space internally (like jpegli).
§Quantization Loss
With u8 quantization of XYB values, the roundtrip introduces some loss:
| Max Diff | % of Colors |
|---|---|
| Exact (0) | 15.7% |
| ≤1 | 71.3% |
| ≤2 | 84.7% |
| ≤5 | 95.8% |
| ≤10 | 99.3% |
Maximum observed difference: 26 levels (for bright saturated yellows). Mean absolute error: ~0.69 per channel.
§XYB Color Space
XYB is a hybrid opponent/trichromatic color space used by butteraugli and JPEG XL. These functions are ported from butteraugli 0.4.0 to avoid depending on private API.
Functions§
- xyb_
roundtrip - Roundtrip RGB through XYB color space with u8 quantization.