<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>429851</bug_id>
          
          <creation_ts>2020-11-30 13:40:09 +0000</creation_ts>
          <short_desc>Black background after applying a GMIC&apos;QT filter</short_desc>
          <delta_ts>2021-12-23 16:42:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>G&apos;Mic for Krita</component>
          <version>4.4.1</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>carolina.pezzente</reporter>
          <assigned_to name="amyspark">amy</assigned_to>
          <cc>ahab.greybeard</cc>
    
    <cc>amy</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/commit/989076d90613167d7897b7f0d3f724b8bec35429</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1980013</commentid>
    <comment_count>0</comment_count>
    <who name="">carolina.pezzente</who>
    <bug_when>2020-11-30 13:40:09 +0000</bug_when>
    <thetext>SUMMARY
When opening GMIC&apos;QT and applying the Rain &amp; Snow filter, the image below the raindrops turns black.

STEPS TO REPRODUCE
1. Create a new empty file (in this case using the A4 300ppi default size, in landscape mode).
2. Choose any image and paste it in a new layer. Scale it to the canvas.
3. Select that layer, then start GMIC&apos;QT. Search the Rain &amp; Snow filter.
In this document, the filter was set with these settings (I include this just in case):
- Angle 80.28
- Speed 7.6
- Density 51.6%
- Radius 0.318
- Gamma 1
- Opacity 1
- Input layers: active
4. Click Ok/Apply

OBSERVED RESULT
Instead of creating a new layer with the original image, the filter is applied on a black background.

EXPECTED RESULT
The filter should be applied on the original image.

SOFTWARE/OS VERSIONS
Windows: 10 64 bit, v. 2004
Qt Version: 2.9.2

ADDITIONAL INFORMATION
There is a workaround for this filter to work: set the new layer blending mode to Addition/Screen and merge it with the layer below.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980019</commentid>
    <comment_count>1</comment_count>
    <who name="Ahab Greybeard">ahab.greybeard</who>
    <bug_when>2020-11-30 14:23:13 +0000</bug_when>
    <thetext>I see this with the 4.4.1 appimage and the Nov 29 4.4.2 alpha (git f8e7b97) appimage when used with the Nov 29 gmic_krita_qt-x86_64.appimage.
The new layer from GMIC is set to Normal blending mode.

With GIMP and GMIC, the &apos;Rain and Snow&apos; Layer is placed above the source inage layer and is set to Screen blending mode.

I don&apos;t know if this is a problem caused by GMIC or a shortfall in krita functionality for interfacing to GMIC.

A quick check of a few GMIC degradation filters (Noise, Dirty, Add Grain, shows that they do not use this multilayer method.

Setting to Confirmed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987275</commentid>
    <comment_count>2</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2020-12-21 11:42:19 +0000</bug_when>
    <thetext>There are *three* bugs rolled into one here:

- Krita does not (yet) parse and apply the layer mode, opacity, and name as sent by GMic, only its position (see https://invent.kde.org/graphics/krita/-/blob/master/plugins/extensions/qmic/kis_import_qmic_processing_visitor.cpp#L56-62, for spec https://discuss.pixls.us/t/how-to-name-a-layer-output-to-gimp/4824/5)

- The GMic layer is improperly inserted *after* the original one (affects all nodes, see https://invent.kde.org/graphics/krita/-/blob/master/libs/image/kis_node.cpp#L505)

- The original layer is not preserved, it gets recreated as &quot;new layer from gmic filter&quot;. It should, at least, preserve its original name (see https://invent.kde.org/graphics/krita/-/blob/master/plugins/extensions/qmic/kis_qmic_synchronize_layers_command.cpp#L49).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1998314</commentid>
    <comment_count>3</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2021-01-27 14:29:46 +0000</bug_when>
    <thetext>Git commit 989076d90613167d7897b7f0d3f724b8bec35429 by Halla Rempt, on behalf of L. E. Segovia.
Committed on 27/01/2021 at 14:28.
Pushed by rempt into branch &apos;master&apos;.

GMic: parse and apply layer ordering and parameters

This implements the correct ordering for received layers and the
parameter specification as used by GMic.

M  +1    -1    libs/image/kis_node.cpp
M  +39   -3    plugins/extensions/qmic/kis_import_qmic_processing_visitor.cpp
M  +5    -0    plugins/extensions/qmic/kis_import_qmic_processing_visitor.h
M  +7    -0    plugins/extensions/qmic/kis_qmic_interface.cpp
M  +84   -2    plugins/extensions/qmic/kis_qmic_simple_convertor.cpp
M  +3    -0    plugins/extensions/qmic/kis_qmic_simple_convertor.h
M  +4    -1    plugins/extensions/qmic/kis_qmic_synchronize_layers_command.cpp

https://invent.kde.org/graphics/krita/commit/989076d90613167d7897b7f0d3f724b8bec35429</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2087765</commentid>
    <comment_count>4</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2021-12-23 16:37:44 +0000</bug_when>
    <thetext>Git commit 540942d8086e32fad496780d18f76addf97cf22e by L. E. Segovia.
Committed on 23/12/2021 at 16:36.
Pushed by lsegovia into branch &apos;master&apos;.

Use the G&apos;MIC formatted layer name for Krita-&gt;G&apos;MIC comms
Related: bug 447293

M  +1    -1    plugins/extensions/qmic/kis_qmic_interface.cpp

https://invent.kde.org/graphics/krita/commit/540942d8086e32fad496780d18f76addf97cf22e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2087771</commentid>
    <comment_count>5</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2021-12-23 16:42:21 +0000</bug_when>
    <thetext>Git commit e003f328f73c438818ef749ec2239ddfbe81cacb by L. E. Segovia.
Committed on 23/12/2021 at 16:38.
Pushed by lsegovia into branch &apos;krita/5.0&apos;.

Use the G&apos;MIC formatted layer name for Krita-&gt;G&apos;MIC comms
Related: bug 447293
(cherry picked from commit 540942d8086e32fad496780d18f76addf97cf22e)

M  +1    -1    plugins/extensions/qmic/kis_qmic_interface.cpp

https://invent.kde.org/graphics/krita/commit/e003f328f73c438818ef749ec2239ddfbe81cacb</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>