[gimp] app: burn-mode, invert before blending



commit 8ca9bfc291496c6054bdaa8a9f2cfc883f66ab52
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Oct 15 13:52:20 2015 +0200

    app: burn-mode, invert before blending

 app/operations/gimpoperationburnmode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/operations/gimpoperationburnmode.c b/app/operations/gimpoperationburnmode.c
index e3bcab5..803e539 100644
--- a/app/operations/gimpoperationburnmode.c
+++ b/app/operations/gimpoperationburnmode.c
@@ -108,10 +108,10 @@ gimp_operation_burn_mode_process_pixels (gfloat              *in,
 
           for (b = RED; b < ALPHA; b++)
             {
-              gfloat comp = (1.0 - in[b]) / layer[b];
+              gfloat comp = 1.0 - (1.0 - in[b]) / layer[b];
 
               out[b] = comp * ratio + in[b] * (1.0 - ratio);
-              out[b] = CLAMP (1.0 - out[b], 0.0, 1.0);
+              out[b] = CLAMP (out[b], 0.0, 1.0);
             }
         }
       else


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