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

On 29 August 2012 19:03, Elle Stone <l elle stone gmail com> wrote:
> Why does /babl/babl/util.h provide functions that transforms back and
> forth between linear gamma TRC and the regular sRGB TRC? I'm sure
> there is a reason, but the reason is not apparent to me.

Babl is a pixel format conversion library. It can convert between RGB
pixel representations with linear gamma and gamma-corrected, separate
alpha channel and premultiplied alpha, or to/from other pixel formats
like HSV, HSL, LAB.

> Why does the /babl/babl/util.h code get executed from fast-float.c,
> float.c, model-rgb.c, model-gray.c, and several other files, resulting
> in endlessly performed conversions between linear and regular sRGB TRC
> in the background of all image processing?
> That conversion from linear gamma to the sRGB tone response curve and
> back gets executed literally hundreds of thousands of time, every time
> you do anything at all using Gimp.

Rendering to to screen / the windowing system is done using sRGB. So
anything that causes canvas updates when the image itself is not in
sRGB will trigger such conversions.
Also, any legacy code paths that are still in place before the
GEGLification might cause conversions to sRGB. I don't know exactly
which parts those are in the current codebase, but anything that uses
the deprecated pixel manipulation functions are likely candidates. I
note that the lcms plugin still uses these interfaces, and I suspect
that is what is causing the implicit (and unwanted) conversions you
are seeing.

Jon Nordby -

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