
2015-04-20 20:14 GMT+02:00 Tavmjong Bah <tavmjong@...8...>:
At each step of the filter chain, the Cairo surface is marked as sRGB or linearRGB via a user data flag. Conversion between sRGB and linearRGB is done as needed. (See ink_cairo_surface_linear_to_srgb()) The end result of the filter chain is then converted to sRGB if necessary. Conversion is done with eight bits per color so it is not ideal but for most filters it seems to be adequate. We can do this for filters as they are always written out as bitmaps when exporting. Doing this for vector objects is more problematic.
OK, I remember now.
The current approach should look adequate in filters.svg because it normally has a white background. The quality problems are only noticeable in dark areas. See attached image. Generating program also attached, compile with:
gcc srgb-roundtrip.c `pkg-config --cflags --libs cairo` -lm -o srgb-roundtrip
This can't be easily fixed without a new 16bpp pixel format in Cairo (which will require a whole new 16bpp compositing pipeline) or using a different renderer, so I don't think we can do anything about this for now.
Regards, Krzysztof