I have been working on an experimental branch of cairo that supports color management for the image and pdf surfaces. I'm currently trying to get Inkscape to use this API so I can test creating color managed PDF files. I'm not familiar with SVG or the Inkscape source and have some questions.
The SVG specification says that compositing can be performed in sRGB or linear RGB color space. I could not find where this is supported in Inkscape. For now I've set the PDF surface color space to sRGB.
What color space are gradients interpolated in? Are all gradient stops the same color space? In my patch I have assumed that all stops have the same color space and used this color space as the interpolation color space.
Can a color space be set for an image?
If anyone is interested the code is here: http://cgit.freedesktop.org/~ajohnson/
To simplify the implementation only RGB color spaces are currently supported.