After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 519503 - Healing Tool - Sample Merged option does not work
Healing Tool - Sample Merged option does not work
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: Tools
2.4.x
Other All
: Normal normal
: 3.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-02-29 12:51 UTC by sam
Modified: 2018-05-24 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Try the healing tool with sample merged in the uppermost layer (2.11 KB, application/octet-stream)
2008-03-03 16:59 UTC, sam
  Details
proposed fix (2.58 KB, patch)
2009-10-16 15:02 UTC, Massimo
rejected Details | Review

Description sam 2008-02-29 12:51:07 UTC
Please describe the problem:
The "Sample Merged" option of the healing Tool does not work. It works just exactly as if the sample merged option weren't enabled. Just the actual layer is taken as the source for healing.

Steps to reproduce:
1. create more than one layer
2. use healing tool with sample merged enabled on the uppermost layer
3. 


Actual results:
only the uppermost layer is used for the sample

Expected results:
all layers are used for the sample

Does this happen every time?
yes

Other information:
I'm using WinGimp v2.4.4
Comment 1 Sven Neumann 2008-03-03 14:30:39 UTC
What makes you think that it wouldn't work? It seems to work fine for me. Perhaps you can attach a small example image to illustrate the problem?
Comment 2 sam 2008-03-03 16:59:29 UTC
Created attachment 106491 [details]
Try the healing tool with sample merged in the uppermost layer

Try to heal the spots with sample merged in the uppermost layer.
Comment 3 sam 2008-03-03 17:03:50 UTC
The bug was classified to appear in all OS's. Since I'm using WinGimp I set it now to Windows. Maybe it's just a bug in the Windows version.
Comment 4 weskaggs 2008-03-03 22:04:28 UTC
Yikes.  I'm not even sure this is a bug -- it makes my head hurt just trying to figure out what the healing tool *ought* to do to a completely transparent layer using "sample merged".  (I know what you expect it to do, Sam, but I'm not sure you ought to expect that.)  
Comment 5 Michael Natterer 2008-03-04 10:58:55 UTC
You can't "heal" something that doesn't exist. The Sample Merged option
applies to the *source* of healing, not to the destination.
Comment 6 sam 2008-03-05 11:20:02 UTC
Maybe I didn't understand the tool correctly. I thought it would work as the healing brush tool of photoshop with the option sample all layers, which does work on empty layers. This way one can use the healing brush in a non destructive way which is very useful. Anyway, thanks for your quick responses.
Comment 7 Michael Natterer 2008-03-05 14:22:01 UTC
Hm that is actually a damn good use case. Reopening so I don't forget about
it, this might be pretty easy to implement... but I might just as well change
my mind and close it again ;)
Comment 8 silentcry80 2008-10-03 10:40:37 UTC
Today I stumbled upon the same thing. The manual suggests that it should work like in Photoshop just like sam described it in #6. So this is still present in Gimp 2.6
Comment 9 gracie 2009-10-12 17:08:35 UTC
Hi all.

I am very interested in this problem also.

I am getting more heavily into professional fashion and beauty image retouching, and as a loyal GIMP user (and fan!) I experience the impossbility of healing towards a transparent layer often.

Many online image retouching tutorials use the heal-to-transparent-layer technique to show a wide range of different effects, whether it be blemish banishing, skin cleaning, smoothing, etc. 

Maybe this isn't really a bug though, and those concerned (including myself) should get together to file a "feature request"?

Thanks very much, and happy gimping all! :)
Comment 10 Massimo 2009-10-16 15:02:30 UTC
Created attachment 145616 [details] [review]
proposed fix

When 'sample merged' is selected, the region corresponding 
to the PDE's boundary condition need to be initialized 
from the whole projection.

The attached patch contains also a fix for an obvious oversight.

patch against app/paint/gimpheal.c of release 2.6.7
Comment 11 Sven Neumann 2009-10-16 20:10:35 UTC
The obvious oversight has nothing to do with this bug, so I've committed it separately:

commit f7ff0903ff9e87caadd70df6dece0bf2b9d88fdb
Author: Sven Neumann <sven@gimp.org>
Date:   Fri Oct 16 22:06:34 2009 +0200

    Fix a width/height confusion in the healing tool algorithm
    
    As pointed out by Massimo Valentini in bug #519503, the code used
    height where width should have been used. Correct.

 app/paint/gimpheal.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
Comment 12 Michael Natterer 2009-10-25 11:12:23 UTC
That patch can't work because the clone tool already uses the paint
core's orig_proj buffer for the clone *source*. We would have to
introduce separate source and dest projection buffers in order to
enable "sample merged" on both sides.
Comment 13 Martin Nordholts 2010-06-23 05:01:37 UTC
Review of attachment 145616 [details] [review]:

Rejecting as per mitch' latest comment.
Comment 14 Michael Natterer 2012-01-08 21:17:54 UTC
Maybe something for 2.10, clearly not for 2.6
Comment 15 Jehan 2017-03-24 03:14:34 UTC
Massimo, did you want to update your patch per Mitch's review for 2.10?
Otherwise, I feel this feature should be bumped to 3.0 milestone.
Comment 16 Jehan 2017-03-24 23:18:20 UTC
In our current effort to get a 2.10 release, I am bumping this non-blocker report to 3.0 milestone. It can still make it to 2.10 if someone provides an updated patch before the release.

Also with our new release policy, the feature will be allowed to be released in a minor 2.10.x version as well.
Comment 17 Massimo 2017-11-11 18:16:37 UTC
(In reply to Jehan from comment #15)
> Massimo, did you want to update your patch per Mitch's review for 2.10?
> Otherwise, I feel this feature should be bumped to 3.0 milestone.

I'm not sure what Mitch intended.
Was it there anything shared with the clone tool?
How the tools work is always a little mysterious to me.

Anyway a quick port to the new code is:


diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index 71a9fd9313..f86e890172 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -563,16 +563,35 @@ gimp_heal_motion (GimpSourceCore   *source_core,
                                     src_rect->width,
                                     src_rect->height));
 
-  gegl_buffer_copy (gimp_drawable_get_buffer (drawable),
-                    GEGL_RECTANGLE (paint_buffer_x, paint_buffer_y,
-                                    gegl_buffer_get_width  (paint_buffer),
-                                    gegl_buffer_get_height (paint_buffer)),
-                    GEGL_ABYSS_NONE,
-                    paint_buffer,
-                    GEGL_RECTANGLE (paint_area_offset_x,
-                                    paint_area_offset_y,
-                                    paint_area_width,
-                                    paint_area_height));
+  if (GIMP_SOURCE_OPTIONS (paint_options)->sample_merged)
+    {
+      gint x = gimp_item_get_offset_x (GIMP_ITEM (drawable));
+      gint y = gimp_item_get_offset_y (GIMP_ITEM (drawable));
+
+      gegl_buffer_copy (gimp_pickable_get_buffer (GIMP_PICKABLE (image)),
+                        GEGL_RECTANGLE (x + paint_buffer_x, y + paint_buffer_y,
+                                        gegl_buffer_get_width  (paint_buffer),
+                                        gegl_buffer_get_height (paint_buffer)),
+                        GEGL_ABYSS_NONE,
+                        paint_buffer,
+                        GEGL_RECTANGLE (paint_area_offset_x,
+                                        paint_area_offset_y,
+                                        paint_area_width,
+                                        paint_area_height));
+    }
+  else
+    {
+      gegl_buffer_copy (gimp_drawable_get_buffer (drawable),
+                        GEGL_RECTANGLE (paint_buffer_x, paint_buffer_y,
+                                        gegl_buffer_get_width  (paint_buffer),
+                                        gegl_buffer_get_height (paint_buffer)),
+                        GEGL_ABYSS_NONE,
+                        paint_buffer,
+                        GEGL_RECTANGLE (paint_area_offset_x,
+                                        paint_area_offset_y,
+                                        paint_area_width,
+                                        paint_area_height));
+    }
 
   mask_buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) mask_buf);
Comment 18 GNOME Infrastructure Team 2018-05-24 12:19:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/266.