GNOME Bugzilla – Bug 780950
Testing hardness and Force with .gbr and .vbr brushes - odd effect with raster brushes
Last modified: 2018-05-24 17:42:03 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).
Created attachment 349321 [details] Figure 1 - explains a emulation ideal to the raster brush with 256px shaped full opacity. Used Gaussian Blur dialog.
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.
Created attachment 349323 [details] Figure 3 - explains what is happening with raster brush when is applied the hardness via tool options slider.
Created attachment 349324 [details] Figure 4 - explains in more details the way and the odd effect of the hardness slider on the raster brush.
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).
Created attachment 349326 [details] Figure 5a - explains as .vbr brush is working in the same and similar conditions of previous figure (Figure 5).
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].
Created attachment 349328 [details] Figure 6 - is an illustration of the discrete variations of the Force x Hardness range applied on the parametric brush.
Created attachment 349329 [details] Figure 7 - is an illustration of the discrete variations of the Force x Hardness range applied on raster brush.
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).
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(-)
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...
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.
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
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?
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 ;-)
(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.
(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(-)
(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.
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.
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.
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.
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.
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.
*** Bug 771020 has been marked as a duplicate of this bug. ***
(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 ;-)
I think that the behavior how is applied the hardness on the raster brushes is not ideal, see figure 3, attachment 349323 [details].
-- 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.