Bug 429851 - Black background after applying a GMIC'QT filter
Summary: Black background after applying a GMIC'QT filter
Alias: None
Product: krita
Classification: Applications
Component: G'Mic for Krita (show other bugs)
Version: 4.4.1
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: amyspark
Depends on:
Reported: 2020-11-30 13:40 UTC by carolina.pezzente
Modified: 2021-12-23 16:42 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description carolina.pezzente 2020-11-30 13:40:09 UTC
When opening GMIC'QT and applying the Rain & Snow filter, the image below the raindrops turns black.

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'QT. Search the Rain & 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

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

The filter should be applied on the original image.

Windows: 10 64 bit, v. 2004
Qt Version: 2.9.2

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.
Comment 1 Ahab Greybeard 2020-11-30 14:23:13 UTC
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 'Rain and Snow' Layer is placed above the source inage layer and is set to Screen blending mode.

I don'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
Comment 2 amyspark 2020-12-21 11:42:19 UTC
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 "new layer from gmic filter". 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).
Comment 3 Halla Rempt 2021-01-27 14:29:46 UTC
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 'master'.

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

Comment 4 amyspark 2021-12-23 16:37:44 UTC
Git commit 540942d8086e32fad496780d18f76addf97cf22e by L. E. Segovia.
Committed on 23/12/2021 at 16:36.
Pushed by lsegovia into branch 'master'.

Use the G'MIC formatted layer name for Krita->G'MIC comms
Related: bug 447293

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

Comment 5 amyspark 2021-12-23 16:42:21 UTC
Git commit e003f328f73c438818ef749ec2239ddfbe81cacb by L. E. Segovia.
Committed on 23/12/2021 at 16:38.
Pushed by lsegovia into branch 'krita/5.0'.

Use the G'MIC formatted layer name for Krita->G'MIC comms
Related: bug 447293
(cherry picked from commit 540942d8086e32fad496780d18f76addf97cf22e)

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