[Openicc] Questions about... QT and colormanagement

Hal V. Engel hvengel at astound.net
Thu Jan 31 11:18:15 PST 2008


On Thursday 31 January 2008 05:51:28 Jan-Peter Homann wrote:
> Hello Cyrill, hello list,
> Did I understand, that QT is able e.g. to handle Images and
> Vectorgraphics in the CMYK colorspace and to rasterize an esemble of
> this objects to a CMYK bytemap file. (Same as for RGB).
>
> Would it be e.g. possible to create some kind of " virtual output
> device" for QT Which buffers the rasterized bytemap. For displaying the
> virtual bytemap on the monitor, a source profile is assigned to the
> bytemap and from this it will be transformed to the monitor profile.

Possible yes.  This is currently not supported.  But there are examples of 
applications like LProf and Krita that use Qt and that do this sort of thing 
as part of the applications code.  In LProf we do the transformation to an 
off screen QImage (a bit map) and then tell Qt to use the transformed image 
as the background on our image display widget.   I don't think it would be 
that hard for the Trolls to add this functionality to their libraries as 
native features but I don't know if this is even on their radar.  Besides 
handling these transformations in our applications is a fairly simple thing 
to implement.

> For printing the bytemap, we would have a similar workflow.
> For PDF export, the assigned profile would be embedded as PDF/X output
> intent.
>
> In Oyranos we could make e.g. different colorsettings, which define,
> what source profile will be assigned to the virtual output device from
> QT and the monitor profile. As littleCMS should be quite fast in
> transformimg bytemaps, this could may be a way for adding some basic
> colormanagement to QT and all applications, which are making use of the
> graphics library from QT.
>
> How much work would it be to realize such kind of basic colormanagement
> on top of QT ?

Qt4 now has support for specifying colors using floating point representations 
(IE. values between 0.0 and 1.0) and this opens up a bunch of possibilities 
that did not exist in Qt3.  I have not explored this in detail yet but this 
fits well with the way we handle image representation in LProf although we 
have been doing all monitor centric representations as 8 bit/channel since 
this is all that was supported in Qt3.   But this opens up the possibility of 
streamlining how we handle image data in LProf now that the Qt4 port is 
underway.

Again many of us are currently doing this in our application code.  But it 
might be possible to implement a new set of color managed image objects that 
are derived from the existing Qt objects.  One of the nice things about Qt is 
that it is object oriented and extending existing objects to add new 
functionality is not that difficult to do relatively speaking (still this 
would not be trivial either).

Looking at the Qt4 QColor class it looks like there is support for CMYK, RGB 
and HVS color spaces both for input and output and in both integer and 
floating point representations (the type is qreal which resolves to a double 
type).  There are get and set functions for each of these types as well as 
conversion functions like toCmyk() and fromCmyk() for all of these.  So it 
appears to me the the QColor class now has many of the building blocks needed 
to be extended for color management and for doing serious imaging work.  The 
Qt3 QColor class was much more limited in the types of representations and 
the richness of the functionality.  Of course until we try to use this new 
functionality we don't know if it really works the way it should.

>
> By the way, are there any color pickers, which make use of the RGB, Gray
> and CMYK colorspaces of QT ?

Since I don't use these widgets I can't comment.

>
> Regards
> Jan-Peter
>
> Cyrille Berger wrote:
> >> 2D graphics libraries on OS level (name and URL)
> >> ------------------------------
> >> - Which 2D graphics libraries exist on OS level, which deliver following
> >> functionalities:
> >>     - representing pixel images, vector graphics and fonts
> >
> > A lot, among which the most famous are Qt, Cairo.
> >
> > For fonts, everyone use the FreeType library.
> >
> >>     - rasterizing a file containing images, vectorgraphic and fonts to a
> >> bytemap image (for display, print, file export)
> >>     - exporting a file containing images, vectorgraphic and fonts as PDF
> >
> > Well the above mentioned libraries do that.
> >
> >> - Which general colorspaces are supported in the graphics library:
> >>     - RGB
> >>     - Gray
> >>     - CMYK
> >>     - Lab
> >>     - Spotcolors (described by name, Lab-value, alternative sRGB-value)
> >
> > Can't say for Cairo, but Qt accept to take values in RGB, Gray and Cmyk.
> > Not sure about the internal logic, but as there is no profile it's not
> > that usefull anyway.
> >
> >> - What desktops can make use of this 2D graphics libray ?
> >
> > All.




More information about the openicc mailing list