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 780950 - Testing hardness and Force with .gbr and .vbr brushes - odd effect with raster brushes
Testing hardness and Force with .gbr and .vbr brushes - odd effect with raste...
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: General
git master
Other Linux
: Normal enhancement
: ---
Assigned To: GIMP Bugs
GIMP Bugs
: 771020 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-04-05 18:57 UTC by jose americo gobbo
Modified: 2018-05-24 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Brushes used in this Test (1.26 KB, application/gzip)
2017-04-05 18:57 UTC, jose americo gobbo
Details
Figure 1 - explains a emulation ideal to the raster brush with 256px shaped full opacity. (159.01 KB, image/jpeg)
2017-04-05 19:00 UTC, jose americo gobbo
Details
Figure 2 - explains a handmade process to emulate the blur. (156.86 KB, image/jpeg)
2017-04-05 19:03 UTC, jose americo gobbo
Details
Figure 3 - explains what is happening with raster brush when is applied the hardness via tool options slider. (109.76 KB, image/jpeg)
2017-04-05 19:05 UTC, jose americo gobbo
Details
Figure 4 - explains in more details the way and the odd effect of the hardness slider on the raster brush. (42.99 KB, image/jpeg)
2017-04-05 19:06 UTC, jose americo gobbo
Details
Figure 5 - explains how is working the raster brush with hardness slider (47.39 KB, image/jpeg)
2017-04-05 19:09 UTC, jose americo gobbo
Details
Figure 5a - explains as .vbr brush is working in the same and similar conditions of previous figure (Figure 5). (39.87 KB, image/jpeg)
2017-04-05 19:10 UTC, jose americo gobbo
Details
Figure 5b - is the illustration with the comparison of blurs on parametric and raster brushes. (92.08 KB, image/jpeg)
2017-04-05 19:12 UTC, jose americo gobbo
Details
Figure 6 - is an illustration of the discrete variations of the Force x Hardness range applied on the parametric brush. (80.47 KB, image/jpeg)
2017-04-05 19:13 UTC, jose americo gobbo
Details
Figure 7 - is an illustration of the discrete variations of the Force x Hardness range applied on raster brush. (87.26 KB, image/jpeg)
2017-04-05 19:14 UTC, jose americo gobbo
Details
Figure 8 - Comparison between parametric and raster brushes with Force default and equal 100. (185.63 KB, image/jpeg)
2017-04-05 19:16 UTC, jose americo gobbo
Details
Test with raster and parametric brushes after commit 3bed373b (174.91 KB, image/gif)
2017-04-08 15:01 UTC, jose americo gobbo
Details
Test with raster and parametric brushes after commit 3bed373b > details (44.18 KB, image/gif)
2017-04-08 15:04 UTC, jose americo gobbo
Details
Test with raster and parametric brushes after commit 3bed373b > details-v2-corrrect (44.23 KB, image/gif)
2017-04-08 18:05 UTC, jose americo gobbo
Details
Test opacity with force to ranges > 50 and < 50 with opacity 50%. (70.64 KB, image/png)
2017-04-11 01:21 UTC, jose americo gobbo
Details
Test to illustrate how force is applied on opacity with the force range < 50 (177.55 KB, image/png)
2017-04-11 03:24 UTC, jose americo gobbo
Details

Description jose americo gobbo 2017-04-05 18:57:33 UTC
Created attachment 349320 [details]
Brushes used in this Test

I have made a series of the tests (making the figures to each part of these tests) to understand the reasons of the behavior differences between raster and parametric brushes around the slider Hardness and Force on Tool Options.

The brushes used on these tests is attached in this report.

# The brushes used on figures 1 to 7 are:
## 00-raster-256px_hardness=1.gbr
## 00-vbr-256px_hardness=1.vbr
# With Dynamic off in all figures.
# The Table 3 of the Figure 8 was made with dabs of the respective hardness value brush.

Figure 1 and Figure 2 > explains a emulation ideal to the raster brush with 256px shaped full opacity, using the Gaussian Blur dialog.

Figure 3 > explains what is happening with raster brush when is applied the hardness via tool options slider.

Figure 4 > explains in more details the way and the odd effect of the hardness slider on the raster brush.

Figure 5 > explains how is working the raster brush with hardness slider... and is possible to see the odd effect on the mark brush. The test in this case was made with Force=0 and testing discrete values of Hardness range (top); and with Hardness=0 to testing discrete values of Force range (bottom).

Figure 5a > explains as .vbr brush is working in the same and similar conditions of previous figure (Figure 5).

Figure 5b > is the illustration with the comparison of blurs on parametric and raster brush made and same way (is only a collage of Figure 5a [on top] and Figure 5 [on bottom].

Figure 6 > is an illustration of the discrete variations of the Force x Hardness range applied on the parametric brush.

Figure 7 > is an illustration of the discrete variations of the Force x Hardness range applied on raster brush.

Figure 8 > illustration with comparison between Parametric and Raster brushes with Force on default=50 and Force=100 (Tables 1 and 2). The Table 3 are the dabs of different .vbr brushes with hardness 0, 25, 50, 75 and 100).
Comment 1 jose americo gobbo 2017-04-05 19:00:02 UTC
Created attachment 349321 [details]
Figure 1 - explains a emulation ideal to the raster brush with 256px shaped full opacity.

Used Gaussian Blur dialog.
Comment 2 jose americo gobbo 2017-04-05 19:03:39 UTC
Created attachment 349322 [details]
Figure 2 - explains a handmade process to emulate the blur.

I have tested to reduce the brush size to avoid the effect of the blur outside of the border brush.
Comment 3 jose americo gobbo 2017-04-05 19:05:47 UTC
Created attachment 349323 [details]
Figure 3 - explains what is happening with raster brush when is applied the hardness via tool options slider.
Comment 4 jose americo gobbo 2017-04-05 19:06:53 UTC
Created attachment 349324 [details]
Figure 4 - explains in more details the way and the odd effect of the hardness slider on the raster brush.
Comment 5 jose americo gobbo 2017-04-05 19:09:29 UTC
Created attachment 349325 [details]
Figure 5 - explains how is working the raster brush with hardness slider

Is possible to see the odd effect on the mark brush. The test in this case was made with Force=0 and testing discrete values of Hardness range (top); and with Hardness=0 to testing discrete values of Force range (bottom).
Comment 6 jose americo gobbo 2017-04-05 19:10:24 UTC
Created attachment 349326 [details]
Figure 5a - explains as .vbr brush is working in the same and similar conditions of previous figure (Figure 5).
Comment 7 jose americo gobbo 2017-04-05 19:12:52 UTC
Created attachment 349327 [details]
Figure 5b - is the illustration with the comparison of blurs on parametric and raster brushes.

Illustration is only a collage of Figure 5a [on top] and Figure 5 [on bottom].
Comment 8 jose americo gobbo 2017-04-05 19:13:42 UTC
Created attachment 349328 [details]
Figure 6 - is an illustration of the discrete variations of the Force x Hardness range applied on the parametric brush.
Comment 9 jose americo gobbo 2017-04-05 19:14:36 UTC
Created attachment 349329 [details]
Figure 7 - is an illustration of the discrete variations of the Force x Hardness range applied on raster brush.
Comment 10 jose americo gobbo 2017-04-05 19:16:45 UTC
Created attachment 349330 [details]
Figure 8 - Comparison between parametric and raster brushes with Force default and equal 100.

Illustration with comparison between Parametric and Raster brushes with Force on default=50 and Force=100 (Tables 1 and 2). The Table 3 are the dabs of different .vbr brushes with hardness 0, 25, 50, 75 and 100).
Comment 11 Ell 2017-04-08 09:54:24 UTC
The following commit to master should make hardness better behaved for raster brushes.  There's still a qualitative difference between generated and raster brushes, but it's closer now overall.

commit 3bed373bff7800269cb1e4f975834fc9daceb51e
Author: Ell <ell_se@yahoo.com>
Date:   Sat Apr 8 04:36:47 2017 -0400

    app: various brush hardness improvements
    
    Fix brush shrinking used to compensate for the blur: avoid over-
    shrinking the brush and changing its aspect ratio.
    
    Change the way hardness maps to blur radius: hardness == 0 maps to
    the largest radius such that, when the kernel is applied to the
    middle pixel of the brush, the kernel is completely within the brush
    bounds, taking brush shrinking into account, *assuming the brush is
    a circle*.
    
    Use the dimensions of the unrotated brush when calculating the blur
    radius, so that rotation doesn't affect the blur amount (the blur
    itself is not isotropic, though, and is applied after rotation, so
    while the blur amount remains uniform, its effect does depend on the
    brush angle.)
    
    Get rid of the blur-radius upper limit -- it's fast enough to handle
    large radii now.

 app/core/gimpbrush-transform.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------
 1 file changed, 86 insertions(+), 68 deletions(-)
Comment 12 jose americo gobbo 2017-04-08 15:01:29 UTC
Created attachment 349525 [details]
Test with raster and parametric brushes after commit 3bed373b

The animation to showing how the deformation of raster dabs with different hardness on tool options.
The raster brush used has Diameter=256px, H=1 (sharped), Spacing=20.
The Force used in the test was the default=50, but apparently doesn't has used...
Comment 13 jose americo gobbo 2017-04-08 15:04:29 UTC
Created attachment 349526 [details]
Test with raster and parametric brushes after commit 3bed373b > details

This animation to showing in detail to raster and parametric the aspect of dab when we apply hardness 60, Force 50.
The brushes used in this test are the same of previous test.
Comment 14 jose americo gobbo 2017-04-08 15:05:25 UTC
I have made some tests and the blur presents deformations and yet the aspect of two ovals superposed (Tool Options slider).
Both effects, deformation and 2 ovals superposed are happening mainly with values under hardness 60 (Tool Options slider).

I am not sure, but if you have the hardness=0 and force=0, the dab resulting be must equal to null? The dab is being printed as circa hardness=10.

See the short animations:
https://bugzilla.gnome.org/attachment.cgi?id=349525
https://bugzilla.gnome.org/attachment.cgi?id=349526
Comment 15 Ell 2017-04-08 15:56:29 UTC
Note that all of these effects are perfectly "expected", in the sense that they are a result of the specific kernel we're using, which hasn't been changed by the last commits (da30b8..5255d91).  The question is, do we actually want this behavior?
Comment 16 jose americo gobbo 2017-04-08 18:05:05 UTC
Created attachment 349527 [details]
Test with raster and parametric brushes after commit 3bed373b > details-v2-corrrect

The animation now is correct... the title are inverted ;-)
Comment 17 jose americo gobbo 2017-04-08 18:08:21 UTC
(In reply to Ell from comment #15)
> Note that all of these effects are perfectly "expected", in the sense that
> they are a result of the specific kernel we're using, which hasn't been
> changed by the last commits (da30b8..5255d91).  The question is, do we
> actually want this behavior?

so, I think that the behavior desirable is as the .vbr is working in the same conditions (similar brush), or rather, the blur process doesn't produce deformations on the dab.
Comment 18 Ell 2017-04-10 14:03:36 UTC
(In reply to jose americo gobbo from comment #14)
> I am not sure, but if you have the hardness=0 and force=0, the dab resulting
> be must equal to null? The dab is being printed as circa hardness=10.

Indeed, force == 0 should paint nothing.  Fixed in master:

commit d4bb12d8b89e30e3f1cdfbe6fba16383a21fd93d
Author: Ell <ell_se@yahoo.com>
Date:   Mon Apr 10 09:41:10 2017 -0400

    app: fix painting with force == 0
    
    Should be a nop, but instead does the same thing as force == 0.5.

 app/paint/gimpbrushcore.c    | 3 +++
 app/paint/gimpheal.c         | 3 +++
 app/paint/gimppaintoptions.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
Comment 19 jose americo gobbo 2017-04-10 17:44:01 UTC
(In reply to Ell from comment #18)
> (In reply to jose americo gobbo from comment #14)
> > I am not sure, but if you have the hardness=0 and force=0, the dab resulting
> > be must equal to null? The dab is being printed as circa hardness=10.
> 
> Indeed, force == 0 should paint nothing.  Fixed in master:
> 
> commit d4bb12d8b89e30e3f1cdfbe6fba16383a21fd93d
> Author: Ell <ell_se@yahoo.com>
> Date:   Mon Apr 10 09:41:10 2017 -0400
> 
>     app: fix painting with force == 0
>     
>     Should be a nop, but instead does the same thing as force == 0.5.
> 
>  app/paint/gimpbrushcore.c    | 3 +++
>  app/paint/gimpheal.c         | 3 +++
>  app/paint/gimppaintoptions.c | 2 +-
>  3 files changed, 7 insertions(+), 1 deletion(-)

Only to understand better the the behavior/scope of Force Parameter, on the Tool Options and on Paint Dynamics, nowadays we don't have documentation about this parameter.

So, I intend this about the Force parameter:
Force is a gain factor controlled via Tool Options and/or via Paint Dynamics through an curve in each of different outputs.

Cases that I have tested now:

a) when we have on Hardness=50 and Force=0, the dab is not printed, and is correct, the Force is working as the statement 1) > H(50)*F(0)=0, OK.
b) when we have on Hardness=0 and Force=0 > the dab is not printed, OK.
c) when we have Hardness=0 and Force=100 > a dab is printed, and it seems not correct > H(0)*F(100)>0, no OK.

It seems that Force value is multiplying some hardness value > 0... though in the slider was chosen zero.
Comment 20 Ell 2017-04-10 20:18:37 UTC
Hardness and force aren't directly related, even if they may seem to have a similar effect in some cases.  While hardness blurs the brush, force remaps the brush's alpha values, after applying the blur and before applying the global opacity.  Force == 50 doesn't change the alpha values, force < 50 decreases the alpha, and force > 50 increases it.  Right now the mapping is always linear, so that new_alpha = 2 * force * old_alpha (with new_alpha capped to 1), although that's admittedly a little icky.
Comment 21 jose americo gobbo 2017-04-11 01:21:58 UTC
Created attachment 349647 [details]
Test opacity with force to ranges > 50 and < 50 with opacity 50%.

Very interesting, this behavior opens to many possibilities to painting, tasks and techniques. 

I need understand well the behavior in relation other outputs, for example, the opacity, maybe is more important and also more simple to verify how 'force' is working fine. 

I have made an small test with opacity 100 and force 50 → is resulting full opacity. 

When I use opacity 50% and I test the range > 50 until to 100... the opacity doesn't change. 
With the same test, opacity 50 and testing force range < 50, is possible to see decreasing only from force < 30, circa.

---
Raster Brush 256 sharp h=1
No dynamics
Paintbrush Tool.
Comment 22 jose americo gobbo 2017-04-11 02:05:29 UTC
I have made a short test with 16bit floating point, with .vbr and the behavior is the same of the anterior test made with default gimp image (8bit, perceptual).
Perhaps is useful read this bug report, #748060.
Comment 23 jose americo gobbo 2017-04-11 02:28:49 UTC
When we have a paint dynamics enabled, for instance, pressure x opacity, the curve is applied normally... but is not clear how is being used the Force range on the tool options, I am not able to verify it.

See https://bugzilla.gnome.org/show_bug.cgi?id=748060#c7

With no dynamics is difficult to verify how Force interacts with other parameter of Tool Options, for instance, opacity. It seems that is not OK.
Comment 24 jose americo gobbo 2017-04-11 03:24:34 UTC
Created attachment 349650 [details]
Test to illustrate how force is applied on opacity with the force range < 50

The curve is obtained from the values of each stroke with different force values.
x > the range of force parameter.
y > the opacity values of each stroke resulting.
The curve is in a log scale.
Comment 25 Michael Schumacher 2017-04-12 19:05:59 UTC
*** Bug 771020 has been marked as a duplicate of this bug. ***
Comment 26 jose americo gobbo 2017-04-12 20:01:11 UTC
(In reply to jose americo gobbo from comment #24)
> Created attachment 349650 [details]
> Test to illustrate how force is applied on opacity with the force range < 50
> 
> The curve is obtained from the values of each stroke with different force
> values.
> x > the range of force parameter.
> y > the opacity values of each stroke resulting.
> The curve is in a log scale.

So sorry, my previous was made in a wrong way... using the stylus pen, now I have use only the mouse and printing the single dabs with different force rate < 50, and is linear ;-)
Comment 27 jose americo gobbo 2018-04-04 00:48:42 UTC
I think that the behavior how is applied the hardness on the raster brushes is not ideal, see figure 3, attachment 349323 [details].
Comment 28 GNOME Infrastructure Team 2018-05-24 17:42:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/1081.