[gegl] sobel: Match classic GIMP behavior more closely



commit 3ef1ad8126829a97c355c293849264a2c3306891
Author: Mukund Sivaraman <muks banu com>
Date:   Fri Oct 10 15:37:38 2014 +0530

    sobel: Match classic GIMP behavior more closely

 operations/common/edge-sobel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/edge-sobel.c b/operations/common/edge-sobel.c
index 59de50d..0ca94c6 100644
--- a/operations/common/edge-sobel.c
+++ b/operations/common/edge-sobel.c
@@ -343,12 +343,12 @@ edge_sobel (GeglBuffer          *src,
             if (keep_sign)
               {
                 for (c = 0; c < 3; c++)
-                  gradient[c] = hor_grad[c] + ver_grad[c];
+                  gradient[c] = 0.5f + (hor_grad[c] + ver_grad[c]) / 8.0f;
               }
             else
               {
                 for (c = 0; c < 3; c++)
-                  gradient[c] = fabsf (hor_grad[c] + ver_grad[c]);
+                  gradient[c] = fabsf (hor_grad[c] + ver_grad[c]) / 4.0f;
               }
           }
 


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