[gimp] Bug 786844 - Issue with grain merge layer mode



commit 33b05cd36715cc5dc8f6a19eb366b1c793ade739
Author: Ell <ell_se yahoo com>
Date:   Thu Sep 28 10:27:11 2017 -0400

    Bug 786844 - Issue with grain merge layer mode
    
    Use 128/255, rather than 0.5, as the half-intensity value for
    legacy layer modes that use it explicitly, to match 2.8 results.

 .../gimpoperationgrainextractlegacy.c              |    2 +-
 .../gimpoperationgrainmergelegacy.c                |    2 +-
 .../gimpoperationhardlightlegacy.c                 |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c 
b/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c
index 1646c0d..091a999 100644
--- a/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c
+++ b/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c
@@ -95,7 +95,7 @@ gimp_operation_grain_extract_legacy_process (GeglOperation       *op,
 
           for (b = RED; b < ALPHA; b++)
             {
-              gfloat comp = in[b] - layer[b] + 0.5;
+              gfloat comp = in[b] - layer[b] + 128.0 / 255.0;
 
               out[b] = comp * ratio + in[b] * (1.0 - ratio);
               out[b] = CLAMP (out[b], 0.0, 1.0);
diff --git a/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c 
b/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c
index fddd93d..eb550ae 100644
--- a/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c
+++ b/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c
@@ -95,7 +95,7 @@ gimp_operation_grain_merge_legacy_process (GeglOperation       *op,
 
           for (b = RED; b < ALPHA; b++)
             {
-              gfloat comp = in[b] + layer[b] - 0.5;
+              gfloat comp = in[b] + layer[b] - 128.0 / 255.0;
 
               out[b] = comp * ratio + in[b] * (1.0 - ratio);
               out[b] = CLAMP (out[b], 0.0, 1.0);
diff --git a/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c 
b/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c
index 96a3233..feeba2f 100644
--- a/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c
+++ b/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c
@@ -97,9 +97,9 @@ gimp_operation_hardlight_legacy_process (GeglOperation       *op,
             {
               gfloat comp;
 
-              if (layer[b] > 0.5)
+              if (layer[b] > 128.0 / 255.0)
                 {
-                  comp = (1.0 - in[b]) * (1.0 - (layer[b] - 0.5) * 2.0);
+                  comp = (1.0 - in[b]) * (1.0 - (layer[b] - 128.0 / 255.0) * 2.0);
                   comp = MIN (1 - comp, 1);
                 }
               else


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