Dynamically auto-load color profile for current display device

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
insertrealname

Dynamically auto-load color profile for current display device

Unread post by insertrealname » 2016-04-02, 03:27

Windows 7 and later versions allow defining different default ICC color profiles for each display device connected to your computer.

My Palemoon feature requests:

1) Palemoon should be capable of using the Windows API to determine if a default color profile has been defined for the display device an individual window is displayed on and Palemoon should then automatically load that profile to apply color management, *if* the color management feature is *explicitly* enabled. This implies that color transforms are applied on a per-window basis and depend on the display device the window is currently displayed on.

2) When a window is moved to another display device, Palemoon should capture that event and load the correct color profile, recalculating the colors of the currently displayed bitmaps;

3) The default rendering intent should be "perceptual": in the case of profiles without an actual perceptual table (or a simple matrix profile) this means effectively "relative colorimetric", which is the usual desired norm;

4) Color management should probably apply to all images according to the W3C standard (i.e. images without an explicit profile are considered to be sRGB source gamut) and to browser chrome by default, since many display devices have a color gamut not equal to, and sometimes exceeding the sRGB standard. E.g. I've two displays on my computer: one covers 98% sRGB and 92% AdobeRGB gamut, while the other does 92% sRGB and 70% AdobeRGB. Calibrated/profiled to the same colorimetric standard, the same image ends up looking different on each display, as expected, when displayed by the Windows 7 photo preview application which is auto-loading the color profiles dynamically per-screen, but less than if individual screen profiles were not used at all. And the same applies to the browser's chrome colors.

Does the Palemoon graphics display architecture allow this kind of per-window color correction? If it did, then Palemoon would be ahead of every other known browser in the terminal color-nerd management stakes!!! :)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35648
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Dynamically auto-load color profile for current display device

Unread post by Moonchild » 2016-04-02, 13:29

Color correction is applied globally, not per-window, using the global ICM profile present in the OS, or sRGB if none is present. It is not possible to have it dynamically adjust for different attached monitors, unless the OS used takes this into account through its own back-end and drivers when moving a color-managed application to a different monitor and supplying a different global profile to the application. Even so, a full repaint will be required, potentially a browser restart (I don't know off-hand if this is determined only on startup, but it's likely).

It is possible to supply a profile definition specifically to Pale Moon via gfx.color_management.display_profile - this takes a full path to an ICM profile for output.

Unfortunately, satisfying the array of needs of terminal color-nerds beyond what is already present is outside of the scope for this project ;)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

insertrealname

Re: Dynamically auto-load color profile for current display device

Unread post by insertrealname » 2016-04-02, 19:12

Thanks for looking into these issues.

I already use the Palemoon/Firefox color management settings to set the display profile and options.

Most Windows graphic applications which (carefully) implement color management use some Windows graphics API to determine the color profile (if any) associated with the display screen on which they start. They then use/cache that information for the Windows graphics display APIs that allow specifying a color profile for display operations & graphic data. I haven't seen any that implement on-the-fly changes in color display dependent on the screen, but since the application is always getting some kind of message when a window is moved, I'm sure it's possible--of course a full repaint is required, but just for that window. (I'm not a programmer...)

Most of those applications also give the option of enable/disable color management, as well as over-riding the automatic loading of the default display profile.

Anyway, the essential basic features are already present & useable in Palemoon.