Empirically, a CoreImage filter which return vec4(0.5, 0.5, 0.5, 1.0) will render grey 188 when it should be 128.
It seems that you need to specify a linear output color space to CIContext, per
https://stackoverflow.com/questions/680 ... rent-color
and
https://stackoverflow.com/questions/638 ... lor-values
The bug is visible if you add the builtin "(CI) Color Invert" filter to the test card; the middle greys, which should map to middle greys, end up blown out and very light. Contrast this to the correct result when using the global "invert color" controls on the test card.