ICC Color profiles

Currently GIMP has no access to the system ICC Color profiles for colour space support and calculations. Ideally the desktop interface should expose this data at /usr/share/color/icc read-only to apps plugging the interface. This would let any app utilise the profiles installed to the host to tune their colour representation.

I understand that for GIMP I can add a system-files interface for now, but It’ld be nice to see the profiles exposed more universally. This system files plug should do the trick for a single app I think:

plugs:
  color-profiles:
    interface: system-files
    read:
    - /usr/share/color/icc

Do you need the ICC color profiles from the host or the base snap ?

I believe from the host, because the color profiles are used by the host to actually drive the monitors so you need to be referencing the same data or all bets are off as to accurate color representation. I don’t know for sure, though, because color theory and how it’s implemented in software is something I know very little about. My basis for believing the host color profiles are required is also informed by the GIMP FlatPak using the host’s profiles instead of shipping its own or referencing the gnome runtime for them.

Need to poke Hughesie over at RedHat - the color expert IIRC.

So then you need not /usr/share/color, you need /var/lib/snapd/hostfs/usr/share/color, or you need a new interface to snapd like system-color-profiles which mounts /var/lib/snapd/hostfs/usr/share/color on top of /usr/share/color and gives you access to /usr/share/color.

However, I say all of that without knowing at all what kind of data is in /usr/share/color, so I don’t know if what a host has in that directory will be binary compatible with what a snap based on i.e. xenial expects to see there. If it’s not binary compatible or something like this then I imagine some apps might be broken by using the host’s files?

ok, I wasn’t certain about the plug definition, so that helps :slight_smile:

The flatpak config (and the actual line that tells the build where the runtime profiles will be found) is at https://github.com/flathub/org.gimp.GIMP/blob/f819d5614ca19d3ffff99f2040881a873daa175f/org.gimp.GIMP.json#L668 - this relies on the flatpak build using --filesystem=host which is right at the top of the file.