On 09/13/2010 01:05 PM, yahvuu wrote:

btw, the red returned from the current GEGL implementation is too dark:
the projection eventually converts to linear light "RGB u8" [1] and
these values get fed directly to the screen, which in contrast expects
gamma-corrected values -- that is, at least when color management is turned off.
[...]

hopefully i'm not needlessly complicating things,
yahvuu


The way I understand it is that GEGL intentionally uses the non-gamma-corrected pixels in order to render like the current modes. (As Øyvind had explained somewhere earlier on the list).

But for the LCH layer modes that is just wrong without being necessary, as there are no legacy LCH modes, and Lab/LCH is whole different thing from doing RGB arithmetic anyway.

I am proposing the attached tiny patch to correct that (Actually I believe someone else described that solution here on the list somewhere, but I maybe confusing it with Øyvind's post).

Handling other modes is an opp and thus completely invisible to me ;o)

There is a very interesting article about operations on non-linear RGB which I think I found linked on bugzilla:
http://www.4p8.com/eric.brasseur/gamma.html

Rupert
>From eb812a330b272dd1579093ae7d9d3076c77e652b Mon Sep 17 00:00:00 2001
From: Rupert Weber <g...@leguanease.org>
Date: Sun, 12 Sep 2010 21:40:19 +0200
Subject: [PATCH] app/gegl: Let GEGL assume sRGB for layer modes

GEGL was using babl's "RaGaBaA" for color layer modes.
Changed to "R'aG'aB'aA" for correct sRGB gamma.
---
 app/gegl/gimpoperationpointlayermode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/gegl/gimpoperationpointlayermode.c b/app/gegl/gimpoperationpointlayermode.c
index 1b59155..a6d145f 100644
--- a/app/gegl/gimpoperationpointlayermode.c
+++ b/app/gegl/gimpoperationpointlayermode.c
@@ -192,10 +192,10 @@ gimp_operation_point_layer_mode_get_new_color_lchab (GimpLayerModeEffects  blend
   float in_lchab[3];
   float lay_lchab[3];
   float new_lchab[3];
-  Babl *ragabaa_to_lchab = babl_fish (babl_format ("RaGaBaA float"),
+  Babl *ragabaa_to_lchab = babl_fish (babl_format ("R'aG'aB'aA float"),
                                       babl_format ("CIE LCH(ab) float"));
   Babl *lchab_to_ragabaa = babl_fish (babl_format ("CIE LCH(ab) float"),
-                                      babl_format ("RaGaBaA float"));
+                                      babl_format ("R'aG'aB'aA float"));
 
   babl_process (ragabaa_to_lchab, (void*)in,  (void*)in_lchab,  1);
   babl_process (ragabaa_to_lchab, (void*)lay, (void*)lay_lchab, 1);
-- 
1.7.0.4

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to