Re: [Gimp-developer] Why the endless background conversions between linear and regular sRGB TRC?

On 30 August 2012 13:55, Elle Stone <l elle stone gmail com> wrote:
> On 8/30/12, Jon Nordby <jononor gmail com> wrote:
>> On 30 August 2012 01:01, Elle Stone <l elle stone gmail com> wrote:
>>> Regarding sRGB and rendering to the screen:
>>> Could you explain more about what you mean by "rendering to the screen
>>> is done using sRGB"? What about the actual monitor profile?
>> Cairo, the library used for rendering to the screen in GTK and GIMP
>> expects its input as sRGB*. See app/display/gimpdisplayshell.c for
>> example of how we use this library. The Babl format "cairo-ARGB32" is
>> short for "R'aG'aB'aA u8": 8 bit unsigned integer gamma-corrected,
>> pre-multiplied alpha. The LCMS plugin is used before this step to do
>> the conversion with the actual monitor profile.
> So if I understand what you are saying (I don't think I do):
> First the lcms plugin converts the image to the actual monitor display profile.
> Then "something" converts the image to sRGB and sends the image to Cairo?
> And then Cairo sends the image to the screen?

You understood me correctly, but what I said it turned out to be
wrong. Quoting myself from the follow up email:

"Corrections : the LCMS display filter module is used, not the LCMS
plugin. File: modules/display-filter-lcms.c
The conversion is done _after_ the image has been rendered into the
Cairo image buffer. See the call to
gimp_color_display_stack_convert_surface in

So the pipeline is at the moment:

GeglBuffer (format depending on image precision setting) -> |
gegl_buffer_get | -> sRGB (without a profile or with the profile of
the document?) -> | display filter stack | -> sRGB in monitor profile
-> | Cairo |

This is actually one more conversion and one step earlier than we need
to. Ideally the pipeline should look like this:

GeglBuffer -> | display filter stack | -> sRGB in monitor profile -> | Cairo |

That way we only convert to the monitor profile as a last step. This
would require GEGLifying the display filter stack and all the modules
it uses.

> I don't think that is what really happens. If it were happening, all
> images displayed by Gimp would have a magenta color cast as displayed
> on my monitor. And they don't. Perhaps Cairo just sends RGB numbers to
> the screen (and doesn't care what these numbers "mean"), and Gimp is
> sending the monitor profile RGB numbers to Cairo.

Yes, you are probably right that Cairo itself does not care about the
meaning of the RGB values, and that this is up to the display system
and screen.

Jon Nordby -

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]