Discussion:
A solution for gamma-adjustment support in Wayland
Kai-Uwe
2016-12-15 12:18:17 UTC
Permalink
Date: Wed, 7 Dec 2016 13:10:52 +0100
### Abstract ###
With the advent of Wayland, our display server has lost a functionality
— access to the graphic cards’ colour loop-up tables — that has been
used to implement, amongst other things, ergonomic functionality. But
we now have a chance to start from scratch and do it the right way.
The assumption of a out of band color communication is not convenient
nor relyable. So colord for ICC stuff in wayland is the bad as is
currently state. Each window system should support proper gamma ramp
access and a way to transport ICC profiles along the logical monitor
connection APIs. So far all color relevant display systems have evolved
like this sooner or later.

libcoopgamma is GPL. A really unacceptable choice for a API, which shall
be used by everyone to reach the goal of a more structured / disciplined
gamma access.

Color correction goes recently more and more into the CLUT direction.
That is different to the per channel gamma APIs you propagate. An
abstraction of gamma versus CLUT is needed. Effects should not be
sticked to a particular technology or they will fail in many cases: e.g.
the need to reinvent this API if one needs a desaturated appearance.

best regards
Kai-Uwe
Mattias Andrée
2016-12-15 15:15:49 UTC
Permalink
On Thu, 15 Dec 2016 13:18:17 +0100
Post by Kai-Uwe
Date: Wed, 7 Dec 2016 13:10:52 +0100
### Abstract ###
With the advent of Wayland, our display server has lost
a functionality — access to the graphic cards’ colour
loop-up tables — that has been used to implement,
amongst other things, ergonomic functionality. But we
now have a chance to start from scratch and do it the
right way.
The assumption of a out of band color communication is
not convenient nor relyable. So colord for ICC stuff in
wayland is the bad as is currently state. Each window
system should support proper gamma ramp access and a way
to transport ICC profiles along the logical monitor
connection APIs. So far all color relevant display
systems have evolved like this sooner or later.
libcoopgamma is GPL. A really unacceptable choice for a
API, which shall be used by everyone to reach the goal of
a more structured / disciplined gamma access.
libcoopgamma is just one implementation, anyone can choose
make there library with whatever license they want. And
Wayland should have their own API which libcoopgamma uses
for Wayland support.
Post by Kai-Uwe
Color correction goes recently more and more into the
CLUT direction. That is different to the per channel
gamma APIs you propagate. An abstraction of gamma versus
CLUT is needed. Effects should not be sticked to a
e.g. the need to reinvent this API if one needs a
desaturated appearance.
I'm aware that per channel ramps is not enough, but it
is available in almost all display servers and is
required for already existing programs. We also need
support for matrices along with the ramps.
Post by Kai-Uwe
best regards
Kai-Uwe
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
Kai-Uwe
2016-12-15 16:51:48 UTC
Permalink
Post by Mattias Andrée
On Thu, 15 Dec 2016 13:18:17 +0100
Post by Kai-Uwe
libcoopgamma is GPL. A really unacceptable choice for a
API, which shall be used by everyone to reach the goal of
a more structured / disciplined gamma access.
libcoopgamma is just one implementation, anyone can choose
make there library with whatever license they want.
from the libcoopgamma README:
more importantly, all programs that
use libcoopgamma can change the gamma ramps without
overriding each others changes

Nice statement. However the chance is high, that your code path will be
ignored by other color configuration systems and thus the user
experience is irritating at best.

Maybe a configuration scheme is a better path then. Different programs
can then implement that scheme.

best regards
Kai-Uwe

PS: please feel invited to the [OpenICC list][1] round the corner. I
really would like to see a convergence of desktop color configuration,
as it makes much sense to users. Redshift and friends are certainly welcome.

[1]: https://lists.freedesktop.org/mailman/listinfo/openicc
Mattias Andrée
2016-12-15 17:06:20 UTC
Permalink
On Thu, 15 Dec 2016 17:51:48 +0100
Post by Kai-Uwe
Post by Mattias Andrée
On Thu, 15 Dec 2016 13:18:17 +0100
Post by Kai-Uwe
libcoopgamma is GPL. A really unacceptable choice for a
API, which shall be used by everyone to reach the goal
of a more structured / disciplined gamma access.
libcoopgamma is just one implementation, anyone can
choose make there library with whatever license they
want.
more importantly, all programs that
use libcoopgamma can change the gamma ramps
without overriding each others changes
Nice statement. However the chance is high, that your
code path will be ignored by other color configuration
systems and thus the user experience is irritating at
best.
I'm not sure I understand what you are trying to say.
Post by Kai-Uwe
Maybe a configuration scheme is a better path then.
Different programs can then implement that scheme.
Can you give an example of what you mean. Do you mean
support for arbitrary colour mapping (a large lookup
table of all colours) and multiplication with matrices?
Post by Kai-Uwe
best regards
Kai-Uwe
PS: please feel invited to the [OpenICC list][1] round
the corner. I really would like to see a convergence of
desktop color configuration, as it makes much sense to
users. Redshift and friends are certainly welcome.
https://lists.freedesktop.org/mailman/listinfo/openicc
_______________________________________________ xdg
https://lists.freedesktop.org/mailman/listinfo/xdg
Kai-Uwe
2016-12-15 19:26:30 UTC
Permalink
Post by Mattias Andrée
On Thu, 15 Dec 2016 17:51:48 +0100
Post by Kai-Uwe
Post by Mattias Andrée
On Thu, 15 Dec 2016 13:18:17 +0100
Post by Kai-Uwe
libcoopgamma is GPL. A really unacceptable choice for a
API, which shall be used by everyone to reach the goal
of a more structured / disciplined gamma access.
libcoopgamma is just one implementation, anyone can
choose make there library with whatever license they
want.
more importantly, all programs that
use libcoopgamma can change the gamma ramps
without overriding each others changes
Nice statement. However the chance is high, that your
code path will be ignored by other color configuration
systems and thus the user experience is irritating at
best.
I'm not sure I understand what you are trying to say.
Your above expressed intention from the README is likely to fail. If a
different system tries to bring effects into the desktop appearance and
uses ramps like your library does or simply restores the calibration
state (gamma ramps) of a given ICC monitor profile, the libcoopgamma
effects are likely to be destroyed.
Post by Mattias Andrée
Post by Kai-Uwe
Maybe a configuration scheme is a better path then.
Different programs can then implement that scheme.
Can you give an example of what you mean.
Writing the effects into a easily parseable (say JSON) configuration
file in a XDG config path along with a signaling mechanism about the
change would certainly help.
Post by Mattias Andrée
Do you mean
support for arbitrary colour mapping (a large lookup
table of all colours) and multiplication with matrices?
ICC abstract profiles can be much more expressive and can easily be
integrated into other systems too. The gamma ramps can be computed from
the profiles by a CMM like lcms. The advantage would be that it might
easily integrate into the wayland way of color management, which so far
offers no gamma access. At the same time can profiling tools temporarily
disable the effects in order to measure device behaviour. Support for
more use cases becomes possible.

ICC color correction works with CLUT tables in display servers or color
servers in some traditional GL enabled window managers. ICC abstract
profiles can be easily chained during CLUT creation.
Post by Mattias Andrée
Post by Kai-Uwe
best regards
Kai-Uwe
PS: please feel invited to the [OpenICC list][1] round
the corner. I really would like to see a convergence of
desktop color configuration, as it makes much sense to
users. Redshift and friends are certainly welcome.
https://lists.freedesktop.org/mailman/listinfo/openicc
Mattias Andrée
2016-12-15 20:01:36 UTC
Permalink
On Thu, 15 Dec 2016 20:26:30 +0100
Post by Kai-Uwe
Post by Mattias Andrée
On Thu, 15 Dec 2016 17:51:48 +0100
Post by Kai-Uwe
Post by Mattias Andrée
On Thu, 15 Dec 2016 13:18:17 +0100
Post by Kai-Uwe
libcoopgamma is GPL. A really unacceptable choice
for a API, which shall be used by everyone to reach
the goal of a more structured / disciplined gamma
access.
libcoopgamma is just one implementation, anyone can
choose make there library with whatever license they
want.
more importantly, all programs that
use libcoopgamma can change the gamma ramps
without overriding each others changes
Nice statement. However the chance is high, that your
code path will be ignored by other color configuration
systems and thus the user experience is irritating at
best.
I'm not sure I understand what you are trying to say.
Your above expressed intention from the README is likely
to fail. If a different system tries to bring effects
into the desktop appearance and uses ramps like your
library does or simply restores the calibration state
(gamma ramps) of a given ICC monitor profile, the
libcoopgamma effects are likely to be destroyed.
Yes, if a program uses e.g. libgamma instead of libcoopgamma
it override what all libcoopgamma-applications have done.
I didn't think this is necessary to clarify, it should be
obvious. However, programs do not need to use libcoopgamma,
the can talk directly with coopgammad or, if the display
server implements cooperative gamma, the directly with the
display server.
Post by Kai-Uwe
Post by Mattias Andrée
Post by Kai-Uwe
Maybe a configuration scheme is a better path then.
Different programs can then implement that scheme.
Can you give an example of what you mean.
Writing the effects into a easily parseable (say JSON)
configuration file in a XDG config path along with a
signaling mechanism about the change would certainly help.
I don't think it's a good idea to have the display server
using files for this, but I would not object to a cg-file
and a cg-filed in cg-tools. An advantage with having this
as separate daemon is that it could be suspended while
editing the files if the daemon uses inotify.

I do not think using just the file system is enough because
it complicates support for running two display servers at
the same time.

I assume that you with “signaling mechanism” mean a way
to signal the daemon to reload the files.
Post by Kai-Uwe
Post by Mattias Andrée
Do you mean
support for arbitrary colour mapping (a large lookup
table of all colours) and multiplication with
matrices?
ICC abstract profiles can be much more expressive and can
easily be integrated into other systems too. The gamma
ramps can be computed from the profiles by a CMM like
lcms. The advantage would be that it might easily
integrate into the wayland way of color management, which
so far offers no gamma access. At the same time can
profiling tools temporarily disable the effects in order
to measure device behaviour. Support for more use cases
becomes possible.
I have not addressed temporarily disabling add effects,
but it's possible to do by sending a signal to coopgammad
to disconnect from the display, use libgamma to reset the
ramps, and when done, send a signal to coopgammad to
reconnect to the display.

When implementing this in Wayland, it have to be solved
by the compositor, or Wayland can choose to add a protocol
for it. In my display server, there isn't really a need
for this, because the profiler can read and block all
communication between the coopgamma server and the gamma
server, read the current ramps, reset the ramps, and
when done, restore the ramps, or the last change the
coopgamma server tried to send to the gamma server, and
then exit. (The display server doesn't really need that
many protocols when given a multi-server architecture.)
Post by Kai-Uwe
ICC color correction works with CLUT tables in display
servers or color servers in some traditional GL enabled
window managers. ICC abstract profiles can be easily
chained during CLUT creation.
Post by Mattias Andrée
Post by Kai-Uwe
best regards
Kai-Uwe
PS: please feel invited to the [OpenICC list][1] round
the corner. I really would like to see a convergence of
desktop color configuration, as it makes much sense to
users. Redshift and friends are certainly welcome.
https://lists.freedesktop.org/mailman/listinfo/openicc
Loading...