[gimp] Bug 783755 - Smudge should blend the smudged colors using linear RGB



commit 94c6bb46030e544f5f9267cd08bdd15fc84fee8a
Author: Michael Natterer <mitch gimp org>
Date:   Fri Aug 18 23:54:26 2017 +0200

    Bug 783755 - Smudge should blend the smudged colors using linear RGB
    
    Looked a bit deeper into heal: while I didn't try to understand what
    it's actually doing, this is strange: there is a comment that says
    that healing should done in perceptual space, and the code uses
    R'G'B'A float (at least it completely did before the last commit).
    
    On the other hand, the code adds and subtracts temporary buffers,
    which screams "gamma artifacts" unless done in linear space.
    
    This commit changes everything to use linear float buffers,
    and removes the comment. It "looks" right to me now, please test.

 app/paint/gimpheal.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index e0e50a0..71a9fd9 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -196,9 +196,9 @@ gimp_heal_sub (GeglBuffer          *top_buffer,
   gint                n_components = babl_format_get_n_components (format);
 
   if (n_components == 2)
-    format = babl_format ("Y'A float");
+    format = babl_format ("YA float");
   else if (n_components == 4)
-    format = babl_format ("R'G'B'A float");
+    format = babl_format ("RGBA float");
   else
     g_return_if_reached ();
 
@@ -239,9 +239,9 @@ gimp_heal_add (GeglBuffer          *first_buffer,
   gint                n_components = babl_format_get_n_components (format);
 
   if (n_components == 2)
-    format = babl_format ("Y'A float");
+    format = babl_format ("YA float");
   else if (n_components == 4)
-    format = babl_format ("R'G'B'A float");
+    format = babl_format ("RGBA float");
   else
     g_return_if_reached ();
 
@@ -552,11 +552,10 @@ gimp_heal_motion (GimpSourceCore   *source_core,
       return;
     }
 
-  /*  heal should work in perceptual space, use R'G'B' instead of RGB  */
   src_copy = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
                                               src_rect->width,
                                               src_rect->height),
-                              babl_format ("R'G'B'A float"));
+                              babl_format ("RGBA float"));
 
   gegl_buffer_copy (src_buffer, src_rect, GEGL_ABYSS_NONE,
                     src_copy,


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