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 785001 - Enhanced smudge tool: Smudge with painting
Enhanced smudge tool: Smudge with painting
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Normal blocker
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2017-07-16 17:49 UTC by Akkana Peck
Modified: 2018-03-30 12:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Enhanced-smudge-tool-Add-painting-ability-to-it (19.67 KB, patch)
2017-07-16 17:49 UTC, Akkana Peck
committed Details | Review
Add-No-erasing-effect-parameter-to-MyPaint-brush (7.23 KB, patch)
2017-07-16 17:49 UTC, Akkana Peck
none Details | Review
Smudge-painting-tool-Add-support-of-gradients (14.14 KB, patch)
2017-07-16 17:50 UTC, Akkana Peck
committed Details | Review
fix the color history issue (2.05 KB, patch)
2018-03-30 08:27 UTC, shark0r
none Details | Review

Description Akkana Peck 2017-07-16 17:49:02 UTC
Created attachment 355720 [details] [review]
Enhanced-smudge-tool-Add-painting-ability-to-it

I'm filing this bug as a favor to amphibulus on IRC so it can be tracked; I have no connection with the patch myself. It originally comes from here:

https://mail.gnome.org/archives/gimp-developer-list/2017-June/msg00012.html

There are three patch files which I will attach.

Here's the text of the message:

Use shark0r, this is the username I used on the internet.


Another work was done.
Patch (includes two patches I posted in April)
https://drive.google.com/file/d/0ByvJcJmOQlkRQjNqcXkwRGw2UlU/view?usp=sharing

Changes:

--Besides current foreground color, now it supports color from gradients and color brushes. --In smudge tool's options -> Dynamics Options, add Color Options to control gradients.

--Fit the coding standards.

Their priority is the same as other paintbrush tools
-If gradient is activated by brush dynamics, use gradient.
-Else if current brush is a color brush, use its color.
-Else it uses foreground colot.

About this smudge painting tool the last work is "gimp-smudge" script procedure.


And about optional and (IMO)less important ideas mentioned before, if no one has requirements, I will not work on them.

--UI text suggestions.
--Supports blend modes other than normal. (Difficult to implement)

--Implement "No erasing effect"(Don't decrease alpha of existing pixels) as layer property.
Comment 1 Akkana Peck 2017-07-16 17:49:39 UTC
Created attachment 355721 [details] [review]
Add-No-erasing-effect-parameter-to-MyPaint-brush
Comment 2 Akkana Peck 2017-07-16 17:50:12 UTC
Created attachment 355722 [details] [review]
Smudge-painting-tool-Add-support-of-gradients
Comment 3 Michael Natterer 2017-07-17 16:32:58 UTC
Thanks for filing the bug. The patches all need quite some cleanup,
but will make it into 2.10.
Comment 4 Michael Natterer 2017-07-23 12:45:35 UTC
Pushed the smudge patches as one patch, cleaned up:

commit bcda53ee7b7725a078cc9033cfb3717659da360e
Author: Michael Natterer <mitch@gimp.org>
Date:   Sat Jul 22 18:20:23 2017 +0200

    Bug 785001 - Enhanced smudge tool: Smudge with painting
    
    Apply patches from shark0r that alow to mix in both constant and
    gradient color while smudging; and clean up the patches.

 app/gegl/gimp-gegl-loops.c       | 159 +++++++++++++++++++++++++++++++++++++++++++--------------
 app/gegl/gimp-gegl-loops.h       |  16 +++---
 app/paint/gimpsmudge.c           | 141 +++++++++++++++++++++++++++++++++++---------------
 app/paint/gimpsmudgeoptions.c    |  44 +++++++++++++---
 app/paint/gimpsmudgeoptions.h    |   2 +
 app/tools/gimppaintoptions-gui.c |   3 +-
 app/tools/gimpsmudgetool.c       |  13 ++++-
 7 files changed, 284 insertions(+), 94 deletions(-)
Comment 5 jose americo gobbo 2017-08-11 22:42:03 UTC
I think interesting to have in this new Smudge tool also:
1. *Blend modes* enabled as other paint tools.
2. *Sample merged* option (as we have in the Clone tool).

With color capability now is possible to think on Smudge tool also as normal paint tool. Provide the option to use blend on the smudge tool increase the possibilities to emulate interesting techniques on GIMP.
Another useful and interesting feature is *Sample merged* (as is possible see on Clone Tool). This render possible to smudge paint on a blank transparent layer, pulling the the colors from the underlying visible layers. This would make it very easy to go back and correct or repaint according to changing artistic goals.

I am not sure if is necessary open another bug report because the point number 2 request.
Comment 6 shark0r 2017-08-13 19:06:29 UTC
Hi, I am the original developer of this patch.

Thanks for posting here and merging into the main stream.
The "No erasing effect" of MyPaint brush was not included though, but at least I'll use that for personal use.

Some additional details of this tool:
details and test drawings
https://www.gimp-forum.net/Thread-Customized-smudge-tool-Smudge-with-painting
talking about UI text
https://mail.gnome.org/archives/gimp-developer-list/2017-April/msg00011.html


About jose americo gobbo's suggestions:

1. *Blend modes* enabled as other paint tools.
I have studied it. It's difficult to implement because smudge tool calculates brush-to-drawable blending by itself, and doesn't use common approach of other brush tools.
This may have benefits but needs many works. May need to reconstruct smudge tool's engine.

2. *Sample merged* option (as we have in the Clone tool).
Havn't thought about this yet. May be easier to implement than 1.
Comment 7 Michael Natterer 2017-08-14 08:28:28 UTC
I just didn't get to apply the other patch, the bug is still open :)
Comment 8 ico.dy.ta 2017-08-18 22:23:14 UTC
I hope you'll add to the smudge tool the fast ctrl+left_click shortcut to pick up the canvas color, in the same way as the paintbrush and the airbrush tool. ^^
Comment 9 Jehan 2017-12-04 23:17:37 UTC
Setting the bug to blocker for the release mostly because there is just a last patch to review (not even an old one so I expect it should still apply either cleanly or with minor changes only) so let's get this done.
Comment 10 Michael Natterer 2018-01-03 01:24:35 UTC
And the last patch:

commit 32280a170b2a109c0d60de14fa96561d094dd7b0
Author: shark0r <b91502038@ntu.edu.tw>
Date:   Wed Jan 3 02:18:02 2018 +0100

    app: Add "No erasing effect" parameter to MyPaint brush
    
    Last and unrelated patch of bug #785001.

 app/paint/gimpmybrushcore.c        |  3 ++-
 app/paint/gimpmybrushoptions.c     | 16 +++++++++++++++-
 app/paint/gimpmybrushoptions.h     |  1 +
 app/paint/gimpmybrushsurface.c     | 17 ++++++++++++-----
 app/paint/gimpmybrushsurface.h     | 11 ++++++-----
 app/tools/gimpmybrushoptions-gui.c |  5 +++++
 6 files changed, 41 insertions(+), 12 deletions(-)
Comment 11 Michael Natterer 2018-01-03 01:30:44 UTC
...and one last thing, almost forgot about this:

commit 119f648a76fa97b05606a2e3c6b76e9d09e8cb63
Author: Michael Natterer <mitch@gimp.org>
Date:   Wed Jan 3 02:29:33 2018 +0100

    Bug 785001 - Enhanced smudge tool: Smudge with painting
    
    Enable color picking with Ctrl-Click in the smudge tool because it now
    uses the foreground color.

 app/tools/gimpsmudgetool.c | 3 +++
 1 file changed, 3 insertions(+)
Comment 12 shark0r 2018-01-04 10:52:27 UTC
I just studied about how to make color picking work a few days ago, but Michael Natterer just did it at the same time.

Anyway, many thanks to everyone.
Comment 13 shark0r 2018-03-13 14:25:40 UTC
I forgot one thing: When painting the foreground color was not added to color history.

Airbrush and Pencil achieve this by inheriting GimpPaintbrush class, and Ink and MyPaint Brush call gimp_palettes_add_color_history() directly. What method should Smudge tool use? Does Smudge tool share many common features with GimpPaintbrush?
Comment 14 shark0r 2018-03-30 08:27:47 UTC
Created attachment 370330 [details] [review]
fix the color history issue

I tried to implement color history feature by calling gimp_palettes_add_color_history() directly.

I chose not to inherit GimpPaintbrush because GimpPaintbrush and GimpSmudge seemed to share few common features.
For example, airbrush uses _gimp_paintbrush_motion() for painting, but smudge tool can't use this function because smudge tool has different mechanism from this function.
Comment 15 Elle Stone 2018-03-30 12:08:08 UTC
(In reply to shark0r from comment #6)

> About jose americo gobbo's suggestions:
> 
> 1. *Blend modes* enabled as other paint tools.
> I have studied it. It's difficult to implement because smudge tool
> calculates brush-to-drawable blending by itself, and doesn't use common
> approach of other brush tools.
> This may have benefits but needs many works. May need to reconstruct smudge
> tool's engine.
> 
> 2. *Sample merged* option (as we have in the Clone tool).
> Havn't thought about this yet. May be easier to implement than 1.

As this bug is now closed as FIXED, I guess adding "Blend modes" and "Sample merged" options to the smudge tool should be posted as new bug reports?
Comment 16 Jehan 2018-03-30 12:18:35 UTC
Yeah please, open new bug reports. Your patch will otherwise be forgotten soon and never reviewed otherwise (and that would be a shame).
Thanks!