[Development] QT5 and color management

Anders Torger torger at ludd.ltu.se
Mon Aug 29 10:20:24 CEST 2016


Hello,

The color management capabilities of QT for displaying images is quite 
hard to figure out. I've searched the internet and you get very few 
hits often pointing to discussions several years old. So I think it's 
appropriate to start a new thread to get the latest.

I'm new to QT, but I'm not new to color management and ICC profiles. 
I've worked a bit with GTK and RawTherapee project so I know how color 
management is handled there in Windows / Linux and OS X.

What you typically do in a cross-platform scenario is that you figure 
out which ICC profile the display has in a platform-specific way (if 
you have multi-head you just have to choose one, haven't seen anyone 
handle a window which is displayed on two screens simultaneously), and 
then you use LittleCMS or other third-party library to convert your 
RGB data yourself to an output that matches the display, and then you 
just put that raw data to the screen using the GUI toolkit. In other 
words, the GUI toolkit doesn't do any color conversions, but just 
delivers the raw pixel values to the display.

This is how you do it in GTK. With GTK there is as far as I know a 
problem on Mac OS X, where GTK is not low-level enough; Mac OS X APIs 
(Quartz?) will do the display conversion always so you can only output 
sRGB(?). I've not worked too much with OS X so I'm not 100% sure how it 
works there or if there is a work-around to get larger color space than 
sRGB. If anyone happens to know that too, I'm all ears.

Now I'm working on a QT-based application, and it needs to be able to 
output high saturation colors to wide gamut displays with correct color 
management, on both Windows and Mac OS X (Linux is only a bonus in this 
project). So the question is simply how is this done with QT -- if 
possible at all.

Anyone who knows? Maybe there's an open-source/example application out 
there that has already solved the problem which we could look at?

We're using QT5.7

/Anders


More information about the Development mailing list