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 557380 - Filter 'Edge Detect/Difference of Gaussians' returns empty image
Filter 'Edge Detect/Difference of Gaussians' returns empty image
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.3
Other All
: Normal minor
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 572072 575659 626303 681817 749786 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-10-22 10:50 UTC by jhe13586
Modified: 2016-10-11 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Quick hack to restore the preview when invert is selected (403 bytes, patch)
2009-07-08 11:13 UTC, Massimo
rejected Details | Review
implement invert in the plug-in to get around gimp_invert shadow issues (3.70 KB, patch)
2010-06-26 19:55 UTC, Seth Burgess
none Details | Review
fix edge-dog for layer with alpha channel (6.52 KB, patch)
2015-10-12 22:44 UTC, Thomas Manni
none Details | Review

Description jhe13586 2008-10-22 10:50:28 UTC
Please describe the problem:
If difference of gaussians edge-detect is used on an image/layer with alpha and the "Invert" option is selected, the result in both preview and final image is fully transparent no matter the original image, or the other DOG settings.
If DOG is used on a non-alpha image, the preview goes completely black, but the actual image results in an edged picture.

Steps to reproduce:
1. Create a new RGB image.
2. In Layers, Add Alpha Channel
3. Choose any brush and paint some squiggles in the image.
4. Select Filters -> Edge Detect -> Difference of Gaussians
5. Ensure the "Invert" image is selected.

Alternatively, do all the steps above, excepting step 2.


Actual results:
On an RGBA image, just get a transparent image. The RGB channels are blank white if the alpha channel is removed.
On a RGB image, just get a black image.

Expected results:
Some colour and value information in RGB channels, and background either white/grey or transparent.

Does this happen every time?
Yes.

Other information:
This version of gimp was built and installed off an Ubuntu Intrepid source file, on a Hardy Heron system. If required, I will rebuild from the gimp source and check.
Comment 1 Michael Schumacher 2008-12-26 23:08:24 UTC
Confirming. For images with no alpha channel, this does result in an all-black layer.
Comment 2 jhe13586 2009-01-22 11:34:23 UTC
Update. Gimp 2.6.4 on windows correctly applies DOG to a non-alpha channel image, but still shows black in the preview.
Not tested with an alpha-image or 2.6.4 on Linux yet.
Comment 3 Michael Schumacher 2009-02-17 11:16:11 UTC
*** Bug 572072 has been marked as a duplicate of this bug. ***
Comment 4 Michael Schumacher 2009-03-17 14:50:07 UTC
*** Bug 575659 has been marked as a duplicate of this bug. ***
Comment 5 Massimo 2009-07-08 11:13:06 UTC
Created attachment 138026 [details] [review]
Quick hack to restore the preview when invert is selected

The attached patch is a quick and dirty hack to restore
the preview when invert is selected. 

The problem is that calling 'gimp_invert' has the side 
effect to free the shadow tiles associated to the drawable 
it receives.

Patch against 'plug-ins/common/edge-dog.c' - release 2.6.6
Comment 6 Sven Neumann 2009-07-08 19:37:50 UTC
That is dirty indeed, the GimpPixelRgn struct should be considered read-only.

I wonder if it would be better if edge-dog.c would just implement invert itself?
Comment 7 Martin Nordholts 2009-07-21 08:10:15 UTC
This hack will be the first of its kind, no other piece of code does this elsewhere in the hole GIMP source tree. I think this hack is too risky for 2.6 and that we should look for a proper fix instead. Maybe introducing and using a new GimpPixelRgn? Or as Sven suggests, implement invert locally in edge-dog.c. Whatever is works best and is the most convenient.

It should be noted that GEGL already has a "gegl:difference-of-gaussians" operation. In other words, we don't have to take future reuse of this code into account.
Comment 8 Seth Burgess 2010-06-26 19:55:21 UTC
Created attachment 164698 [details] [review]
implement invert in the plug-in to get around gimp_invert shadow issues

Fixes the preview issue which is the subject of the bug.

Implement invert in the plug-in, inside the (now renamed) normalize routine so we're not needlessly iterating twice in the usual case.  It is potentially slower if normalize is off, since an extra multiplication by 1 is done on each pixel in that case, but I think its normally run with "normalize" and I think its a decent tradeoff.
Comment 9 Sven Neumann 2010-06-29 19:04:20 UTC
Review of attachment 164698 [details] [review]:

Looks good to me. A patch created from a git commit using git-format-patch would be even better though...
Comment 10 Michael Schumacher 2010-08-07 12:16:06 UTC
*** Bug 626303 has been marked as a duplicate of this bug. ***
Comment 11 LightningIsMyName 2010-09-13 00:31:01 UTC
Committed to master and gimp-2-6 branches

commit 90eda12905273aa1ab0b53bcf3898e2a61037367
Author: Seth Burgess <sjburges@gimp.org>
Date:   Mon Sep 13 02:08:05 2010 +0200

    plug-ins: Fix preview in Difference of Gaussians
    
    Implement invert as part of normalize routine - See Bug 557380
Comment 12 Max Mustermann 2012-10-13 06:39:06 UTC
*** Bug 681817 has been marked as a duplicate of this bug. ***
Comment 13 Max Mustermann 2012-10-13 06:41:14 UTC
The same is again with GIMP 2.8.2 on Win and Mac. 
As the reporter of bug #681817 stated: The respective GEGL operation works, so he's not sure whether this is still worth fixing.
Comment 14 jluscher 2013-03-16 21:23:32 UTC
I ran into this on GIMP 2.8.2 on Ubuntu 12.10

What I noticed is that the PREVIEW looks good - but the preview result
is not copied (written) into the image.

Here is an example (pre/post) http://ubuntuone.com/7j8j1V7bEz0XIo8TVKlexF

James
Comment 15 Michael Schumacher 2015-05-26 13:12:15 UTC
*** Bug 749786 has been marked as a duplicate of this bug. ***
Comment 16 Adrian Likins 2015-06-04 03:42:33 UTC
This seems to have been fixed with the change to replace the edge detect plugin with the GEGL edge ops (573f0f69bbad6c06b18fd90c833132034912e423 in gimp master).
Comment 17 Michael Natterer 2015-06-13 14:21:04 UTC
This is about the Difference of Gaussians plug-in, not the Edge plug-in.
Comment 18 Thomas Manni 2015-10-12 22:44:21 UTC
Created attachment 313149 [details] [review]
fix edge-dog for layer with alpha channel

Copy the original alpha channel to the shadow buffer during pixels difference computation.
Is this the expected plug-in result ?
Anyway, it is better than the current result...
Comment 19 gquentin 2016-03-18 12:17:43 UTC
Confirmed on ubuntu 15.10 with gimp 2.8.

The resulting image is totally erased (transparent), whereas the preview is ok.
Comment 20 gquentin 2016-03-18 12:32:34 UTC
(In reply to gquentin from comment #19)
> Confirmed on ubuntu 15.10 with gimp 2.8.
> 
> The resulting image is totally erased (transparent), whereas the preview is
> ok.

The GEGL tool, DOG, works correctly.
Comment 21 Michael Schumacher 2016-05-30 09:10:23 UTC
Let's see if we can fix this for 2.8, too.
Comment 22 erik 2016-07-13 20:22:21 UTC
See the issue on Windows 10 w/ v 2.8.16.

Wondering if a fix will be forthcoming and in which release.

Thanks.
Comment 23 Michael Schumacher 2016-07-14 07:24:28 UTC
The question to answer would be whether the patch attached with comment 18 produces the expected result.
Comment 24 erik 2016-07-15 19:52:14 UTC
I asked because after comment 18 there were several other posts that said they still had the problem, along with a comment "Let's see if we can fix this for 2.8 too.", which led me to believe that the fix was only for 2.6.

Even if I had figured that out, I have no idea how to apply the patch attached with comment 18. I happen to be a user, not a developer. Can you throw me a bone here?
Comment 25 Michael Natterer 2016-10-08 21:17:07 UTC
Thomas, can you just apply the patch if it makes things better?
Comment 26 Michael Schumacher 2016-10-10 08:53:57 UTC
The most recent patch introduces a new translatable string. 

+          g_message (_("Region affected by plug-in is empty"));

We are currently in a string freeze for gimp-2-8. Unless this message is identical to an already translated message, it can't go in until after the freeze and release of 2.8.20.

https://wiki.gnome.org/TranslationProject/HandlingStringFreezes
Comment 27 Thomas Manni 2016-10-11 14:45:58 UTC
(In reply to Michael Schumacher from comment #26)
> The most recent patch introduces a new translatable string. 
> 
> +          g_message (_("Region affected by plug-in is empty"));
> 
> We are currently in a string freeze for gimp-2-8. Unless this message is
> identical to an already translated message, it can't go in until after the
> freeze and release of 2.8.20.
> 
> https://wiki.gnome.org/TranslationProject/HandlingStringFreezes

"Region affected by plug-in is empty" is an already translated string, found on iwarp and whirl-pinch plug-ins.
Comment 28 Thomas Manni 2016-10-11 14:47:56 UTC
Pushed to gimp-2-8

commit 27604f579cec54ef80bcb9a08aff2c699e850e9c
Author: Thomas Manni <thomas.manni@free.fr>
Date:   Tue Oct 11 16:26:59 2016 +0200

Bug 557380 - Filter 'Edge Detect/Difference of Gaussians' returns empty image
    
Copy the original alpha channel (if exists) to the shadow buffer during
pixels difference computation.

 plug-ins/common/edge-dog.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
 1 file changed, 52 insertions(+), 33 deletions(-)