URL:
  <http://gna.org/bugs/?20131>

                 Summary: Support XICC (display color profiles)
                 Project: MyPaint
            Submitted by: achadwick
            Submitted on: Mon Sep  3 13:20:38 2012
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: Wish
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
         Planned Release: None
        Operating System: 

    _______________________________________________________

Details:

MyPaint should support the ICC Profiles In X Specification
<http://www.burtonini.com/computing/x-icc-profiles-spec-latest.html> when
running under X11, and also permit a display profile to be set explicitly in
the preferences under non-X11 environments. It would be nice to offer three
options:

* No display colour management
* Manual display colour management using an on-disk .icc profile
* Automatic display colour management using XICC

It's relatively easy to get an ICC profile from X for the single-screen case:


    # very incomplete demo code
    display = gdk.display_get_default()
    n_screens = display.get_n_screens()
    if n_screens == 1:
        # Note: single-monitor case as well, see note below
        screen = display.get_default_screen()
        root_win = screen.get_root_window()
        icc_profile_atom = gdk.atom_intern("_ICC_PROFILE")
        property = root_win.property_get(icc_profile_atom)
        if property is None:
            return None
        type, format, data = property
        assert type == "CARDINAL"
        assert format == 8
        return data
    else:
        print "TODO: multi-head display, Xinerama style"


The GDK monitor number which corresponds with XICC's concept of a "screen"
number. Inkscape builds an "_ICC_PROFILE_%d" from gdk_screen_get_n_monitors()
indices, and reads the property via the root window of the screen:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/ege-color-prof-tracker.cpp

Possibly connect to the main window's configure-event to figure out the
display profile to use at configure time. What we'll lack under PyGTK is any
tracking or monitoring of ICC profile changes if the user doesn't also
reconfigure the window. For that, Inkscape uses a GDK event filter on the root
window and decodes the changes via the X11 APIs, however PyGTK doesn't have
that available, and all a PyGTK event filter sees is a stream of "<enum
GDK_NOTHING of type GdkEventType>"s.

If necessary, we can write the event filter in C and have it call a Python
callback like the one above.

Certainly, the display code will need to be updated to actually use the
gleaned ICC information: I'm envisaging a pipeline like


  buffer-15bpc
  buffer-15bpc
  buffer-15bpc
      |
      |
      | composite layers (maybe cache one day?)
      |
      V
  buffer-15bpc   ---bitshift--->   buffer-16bpc  ---lcms2--->  display-8bpp






    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?20131>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Mypaint-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-bugs

Reply via email to