
On Mon, 2015-04-20 at 18:12 +0200, Krzysztof Kosiński wrote:
2015-04-20 17:22 GMT+02:00 Tavmjong Bah <tavmjong@...8...>:
On Mon, 2015-04-20 at 14:31 +0200, Krzysztof Kosiński wrote:
Fortunately SVG has the CSS properties color-interpolation and color-interpolation-filters that allow you to specify what you want. Almost no-one supports them yet, but the migration path is already laid out.
Small correction: Almost everybody, including Inkscape, supports color-interpolation-filters as its default value is linearRGB.
But do we actually compute filters in linear RGB when that property is set to 'linearRGB'?
I know that all filter code relies on Cairo and is 8bpp, so we either do linear RGB filters poorly or not at all.
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.
Tav