Color management in Wayland
samuel.rodal at nokia.com
Wed Oct 12 10:00:39 PDT 2011
On 10/08/2011 03:40 PM, ext Zoxc wrote:
> Personally I believe frames to be imperfect if they have the wrong
> colors, so I have a few questions and statements about color management.
I do agree that knowing what colors a buffer represents is be pretty
essential. I'll try to answer based on my "conclusions" from the recent
informal discussion on the #wayland IRC channel :)
> The compositor requires information about what color spaces the
> application uses.
> How will clients specify the color space of surfaces?
> Should clients have the ability to attach a ICC profile to surfaces?
It seems most logical that this will be handled in an extension, instead
of being in the core Wayland protocol. It probably makes sense to have
sRGB as the default and guaranteed supported color buffer format by the
compositor. The compositor can then advertise that it supports other
color spaces via an extension.
> Should non-sRGB surfaces be moved to an Wayland-extension?
> Consider the case of a video player using sRGB for the interface and
> xvYCC for the video.
> Should the client blend the two buffer into a superset of the color spaces?
If the compositor advertises via an extension that it supports raw xvYCC
then it might be an option to use two buffers for that. Otherwise
convert the xvYCC content it into a color space that the compositor
_does_ support (potentially sRGB), and blend it into the same buffer as
> Should the client have multiple surfaces and let the compositor do the
Depends. If the compositor does advertise xvYCC support then maybe it's
best to let it do the blending.
> How would resizing work in the latter case?
I guess a surface can have multiple buffers according to the wayland
protocol, so that shouldn't be a problem.
> Display calibration tools require the ability to display an unmodified
> color. How would that be handled?
An extension specific "monitor" color space perhaps?
> All blending must be done in linear space. It may be beneficial to
> promote use of 16-bit floating point per channel buffers with
> premultiplied alpha. Using premultiplied alpha and linear space also
> prevent artifacts with texture filtering.
Yep, that's great to have in a quality desktop compositor, but the
wayland protocol can't enforce anything like that.
More information about the wayland-devel