Colors in OpenVG other than those stored in image pixels are represented as non-premultiplied sRGBA color values. Color and alpha values lie in the range
[0, 1] unless otherwise noted.
The linear lRGB color space is defined in terms of the standard CIE XYZ color space, following ITU Rec. 709 using a D65 white point:
The sRGB color space defines values Rs, Gs, Bs in terms of the linear lRGB primaries by applying a gamma γ mapping.
lRGB to sRGB conversion:
sRGB to lRGB conversion:
The linear grayscale (luminance) color space is related to the linear lRGB color space by the equations:
The perceptually-uniform grayscale color space is related to the linear grayscale (luminance) color space by the gamma γ mapping:
Conversion from perceptually-uniform grayscale to sRGB is performed by replication:
The following table summarizes the steps needed to convert one color space into another. The source format is in the left column, and the destination format is in the top row. The numbers indicate the equations from this section that are to be applied, in left-to-right order:
|sRGB||2||-||2, 3||2, 3, 5|