Bug 252882

Summary: Filter brush doesn't respect transparency
Product: [Applications] krita Reporter: animtim
Component: Brush enginesAssignee: LukasT <lukast.dev>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, halla, lukast.dev, user581
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description animtim 2010-09-30 17:14:37 UTC
Version:           svn trunk (using KDE 4.4.2) 
OS:                Linux

When using any filter with filter brush on a semi-transparent area it makes it opaque.

(To me this is exactly the same bug that with smudge brush doesn't respect transparency !!! )

Reproducible: Always

Steps to Reproduce:
On a transparent layer, draw something with a low opacity.
Use the filter brush on it (with a blur effect for example) 

Actual Results:  
The blurred zone is opaque. (The brush remove transparency where it is applied)

Expected Results:  
The blurred zone should still be low opacity (or in other words the Filter brush should blur Alpha channel too)
Comment 1 LukasT 2010-09-30 17:52:54 UTC
This bug is probably the same as the smudge one and as this one
https://bugs.kde.org/show_bug.cgi?id=217124
Comment 2 animtim 2010-09-30 18:19:30 UTC
Yes it's the same bug. I've reported more infos as you asked in bug 
https://bugs.kde.org/show_bug.cgi?id=217124
Comment 3 Sven Langkamp 2011-01-28 23:58:43 UTC
*** Bug 264196 has been marked as a duplicate of this bug. ***
Comment 4 Halla Rempt 2011-03-26 10:44:43 UTC
probably needs the the plassy treatment :-)
Comment 5 LukasT 2012-07-07 14:34:03 UTC
Git commit 6d9415f158e6de80ef8ddd0765b4c1599dbae624 by Lukáš Tvrdý.
Committed on 07/07/2012 at 16:29.
Pushed by lukast into branch 'master'.

Enable composite and opacity options for filter brush

o probably forgotten port since commit 19a60300a5507ec5e31a0e3389aed85956f66d10
o composite op support is important for some filters, see commit 36bb81fbf5fac9da1186186c5ba31c284d712b1e

M  +2    -2    krita/plugins/paintops/filterop/kis_filterop.cpp
M  +4    -1    krita/plugins/paintops/filterop/kis_filterop_settings_widget.cpp

http://commits.kde.org/calligra/6d9415f158e6de80ef8ddd0765b4c1599dbae624
Comment 6 LukasT 2012-07-07 14:36:37 UTC
@Animtim: can you try to play with the Filter op in the "COPY" composite mode if that is desired behaviour? 

There are some extra transparent pixels copied currently but we can prevent them using mask when compositing.
Comment 7 Dmitry Kazakov 2013-04-21 11:09:22 UTC
Is this bug still actual? I tested it a bit and it looks like the filter just paints above the source layer with a filtered source. So that the opacity gets a bit higher due to that, but it doesn't become fully opaque.

Animtim, could you tell what behavior do you expect?
Comment 8 animtim 2013-04-21 15:10:26 UTC
@Dmitry: yes this bug is still actual.
For example, if I paint with a blur filter brush, I expect it to apply a blur filter on the painted area (and so keeping it's transparency similar, just blurred..), not to paint-over a blurred version of the layer content.

@LukasT: I tried with "copy" blending mode, doesn't work right at all (I think I answered this request on IRC when you asked it, I should have pasted it here too).
Comment 9 Dmitry Kazakov 2013-04-21 15:42:25 UTC
Hm... Probably, you should use the Filter Mask instead. But then I don't know what is the usecase for the filter brush
Comment 10 Halla Rempt 2013-04-22 07:00:51 UTC
For instance, adding a bit of a blur in a freehand style, or painting with the dodge and burn filters.
Comment 11 Dmitry Kazakov 2013-04-22 07:23:13 UTC
Ok, there is another bug, actually. The Blur filter paints with an offset. Probably, due to need-rect offset.
Comment 12 Dmitry Kazakov 2013-04-22 11:09:14 UTC
Git commit 36ea0cacad1a3bd87ce655c537064261fd5cf46e by Dmitry Kazakov.
Committed on 22/04/2013 at 13:07.
Pushed by dkazakov into branch 'master'.

Fixed three bugs and add a feature to KisFilterOp

1) Fixed painting on semi-transparent images. Now COMPOSITE_COPY is the
   default mode and it works nicely!
2) Added a feature: Smudge Mode for the Filter Op. The temporary device is
   not cleared every time, which creates really nice effects.
3) Fixed loading of the default filter configuration for the Filter Op
4) Fixed an offset bug when painting with Gaussian Blur.

M  +-    --    krita/plugins/paintops/defaultpresets/filter.kpp
M  +31   -37   krita/plugins/paintops/filterop/kis_filterop.cpp
M  +3    -1    krita/plugins/paintops/filterop/kis_filterop.h
M  +6    -3    krita/plugins/paintops/filterop/kis_filterop_settings_widget.cpp
M  +2    -2    krita/plugins/paintops/libpaintop/forms/wdgfilteroption.ui
M  +5    -7    krita/plugins/paintops/libpaintop/kis_filter_option.cpp
M  +2    -5    krita/plugins/paintops/libpaintop/kis_filter_option.h
M  +4    -2    krita/ui/kis_paintop_box.cc

http://commits.kde.org/calligra/36ea0cacad1a3bd87ce655c537064261fd5cf46e