If a pictorial color image is stored as red, green and blue (RGB) channels, it must use lossless compression to avoid smearing of primary colors.
If the three color channels of a pictorial color image use lossy compression, storage as RGB channels is not suitable, because lossy compression spatially affects different channels differently, causing primary colors to smear relative to each other.
To use lossy compression,
the three color channels must be decorrelated.
For effective high definition color decorrelation,
the XRH file format uses
The following formulas (Figure 1) convert RGB colors to YCbCr:
αr = 0.2126 αg = 0.7152 αb = 0.0722
Y = αr · R + αg · G + αb · B
Cb = 0.5 (B − Y) ⁄ (1 − αb)
Cr = 0.5 (R − Y) ⁄ (1 − αr)
Y is the image intensity (luminance). It is the weighted average of the RGB channels. The weights (αr αg and αb) are derived from the following chromaticities (Figure 2):
xr
=
0.6400
yr
=
0.3300
xg
=
0.3000
yg
=
0.6000
xb
=
0.1500
yb
=
0.0600
xw
=
0.3127
yw
=
0.3290
Those are the default chromaticities that are automatically used if zero is specified for the chromaciticities in the XRH file header.
To use weights other than the weights shown
in
Color transformation using
To use a color transformation other than
Newer XRH version recommended for new applications: