Bug 408684 - Edge Detection Filter Masks and Layers show problem behaviour
Summary: Edge Detection Filter Masks and Layers show problem behaviour
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Filter Layers (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-14 11:29 UTC by Ahab Greybeard
Modified: 2019-09-22 09:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A sample .kra file to illustrate the problem (566.88 KB, application/binary)
2019-06-14 11:29 UTC, Ahab Greybeard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahab Greybeard 2019-06-14 11:29:02 UTC
Created attachment 120861 [details]
A sample .kra file to illustrate the problem

SUMMARY
This has been noted using the latest Nightly appimage build krita-4.3.0-prealpha-89b58a7-x86_64.appimage	

An Edge Detection filter used in a Filter Mask or as a Filter Layer gives inconsistent and incorrect results.
When first opened, the sample file shows a painted blue letter 'Z' on a transparent layer over a white background layer. The Z layer has three filter masks on it, a Prewitt Edge Detection Mask of 1x1 px no alpha, a Gaussian Blur of 15x15 px and a noise generator mask, all masks initially turned off.
It also has a filter layer above it which is also Prewit Edge Detection 1x1 px no alpha, initially turned off.
[There is also a 'Z on White' layer and a black background layer for further experimentation and investigation if desired.]


STEPS TO REPRODUCE
1. Turn on, then off again, each of the filter masks on the Z layer in turn and note that the result is as would be expected.
2. Turn on only the Gaussian Blur mask then also turn on the Edge Detection mask. The result is strange and wrong with gross errors.
3. Then turn on the Noise mask and note that the result is now as may be expected.
4. Note that if the Edge Detection mask is placed below the Gaussian Blur mask then the result is correct with no gross errors.
5. Turn off all the filter masks to give the unaffected Z layer. Then turn on the Edge Detection Filter Layer. The result is total transparency.
6. Turn off the white background layer and note that the result is as would be expected (on a transparent background).
7. Go back to all masks off with the Z layer showing over the white background layer. Delete the Prewitt filter mask layer then create a new filter mask layer in it's place and set it to Edge Detection - Prewitt - 1x1 px no alpha. Note that the result is as would be expected.
8. Turn off the newly created filter layer then turn it back on again. The result is total transparency.
9. The above is true for all types of Edge Detection filter but enabling the alpha channel gives different results.


OBSERVED RESULT
See above

EXPECTED RESULT
Errors noted above should not happen.

SOFTWARE/OS VERSIONS
Krita

 Version: 4.3.0-prealpha (git 89b58a7)
 Languages: en_GB, en
 Hidpi: true

Qt

  Version (compiled): 5.12.3
  Version (loaded): 5.12.3

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.9.0-9-amd64
  Pretty Productname: Debian GNU/Linux 9 (stretch)
  Product Type: debian
  Product Version: 9

ADDITIONAL INFORMATION
Comment 1 wolthera 2019-09-21 15:45:18 UTC
Hey, Ahab, can you still reproduce this with the latest nightly? Because dmitry did some changes to this filter, and I can't see anything odd with the current result.
Comment 2 Ahab Greybeard 2019-09-22 09:15:25 UTC
Setting to Resolved Fixed

The recent improvements to the Prewitt filter have fixed this problem. (The transparent background seems to have been the cause.)