Bug 288696 - [wish] textured brush strokes
Summary: [wish] textured brush strokes
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 249268 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-11 08:39 UTC by David REVOY
Modified: 2013-04-26 12:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
example of wanted textured stroke (607.01 KB, application/zip)
2012-03-29 23:32 UTC, animtim
Details
Textured stroke decomposed with layers (81 bytes, text/plain)
2012-04-10 17:14 UTC, animtim
Details
Textured stroke decomposed with layers (re-uploaded) (125 bytes, text/plain)
2012-04-10 20:21 UTC, animtim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2011-12-11 08:39:33 UTC
Version:           svn trunk
OS:                Linux

Here is a request for the evolution of the brush->color->source->pattern choice in the brush editor. The goal is to transform it to make it able to use textured brush.
I wrote an article with screenshots, ressources, mockup and all what I know about to make the documentation the best I could : 
http://www.davidrevoy.com/index.php?article107/textured-brush-in-floss-digital-painting

Thanks in advance for the ones who will be interested to study it , or even to work on it. 

Reproducible: Always



Expected Results:
Comment 1 Halla Rempt 2011-12-11 15:56:23 UTC
Ack, thanks for the essay. I think we need to implement this (after 2.4 has been released).
Comment 2 Halla Rempt 2012-03-29 19:23:49 UTC
Git commit 8fad4e70d41c60783ecd7a16af4fa329058335fe by Boudewijn Rempt.
Committed on 29/03/2012 at 21:20.
Pushed by rempt into branch 'master'.

Create a textured painting option for Krita brushes

see http://www.davidrevoy.com/index.php?article107/textured-brush-in-floss-digital-painting
for the inspiration for this feature.

Things to consider:

 * which other brush engines can make use of this option?
 * what other options would be fun to implement?
 * is the cutoff feature functionally similar to grain? It looks
   a bit like it.

M  +9    -8    krita/plugins/paintops/chalk/chalk_brush.cpp
M  +1    -1    krita/plugins/paintops/chalk/kis_chalkop_option.cpp
M  +1    -1    krita/plugins/paintops/chalk/kis_chalkop_option.h
M  +22   -16   krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp
M  +5    -2    krita/plugins/paintops/defaultpaintops/brush/kis_brushop.h
M  +4    -0    krita/plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp
M  +1    -1    krita/plugins/paintops/deform/kis_deform_option.cpp
M  +12   -2    krita/plugins/paintops/libbrush/kis_brush.cpp
M  +1    -0    krita/plugins/paintops/libpaintop/CMakeLists.txt
M  +7    -5    krita/plugins/paintops/libpaintop/kis_color_source.cpp
M  +3    -3    krita/plugins/paintops/libpaintop/kis_compositeop_option.cpp
M  +1    -1    krita/plugins/paintops/libpaintop/kis_compositeop_option.h
M  +6    -0    krita/plugins/paintops/libpaintop/kis_paintop_option.cpp
M  +1    -0    krita/plugins/paintops/libpaintop/kis_paintop_option.h
A  +367  -0    krita/plugins/paintops/libpaintop/kis_texture_option.cpp     [License: LGPL (v2+)]
A  +89   -0    krita/plugins/paintops/libpaintop/kis_texture_option.h     [License: LGPL (v2+)]
D  +0    -12   krita/plugins/paintops/preset_todo.txt
M  +3    -1    krita/ui/widgets/kis_multipliers_double_slider_spinbox.cpp
M  +1    -1    krita/ui/widgets/kis_multipliers_double_slider_spinbox.h
M  +31   -0    krita/ui/widgets/kis_pattern_chooser.cc
M  +12   -1    krita/ui/widgets/kis_pattern_chooser.h
M  +22   -4    libs/widgets/KoResourceItemChooser.cpp
M  +4    -1    libs/widgets/KoResourceItemChooser.h

http://commits.kde.org/calligra/8fad4e70d41c60783ecd7a16af4fa329058335fe
Comment 3 David REVOY 2012-03-29 22:48:28 UTC
Very nice news to know the branch was merged in master.

a doodle to test :
http://wstaw.org/m/2012/03/30/20120330_screenshot_01.jpg
In my test, preset (save/load) with external resources worked great , and I didn't get crash on a little hour of doodling, erasing .... -playing-  :)  The performance also feel better than on my last test. 

Super smart solution about the 'Cutoff' , I very liked it. Now the 'grain' works really well, and it's possible to have an idea of effect in mind, and take a texture, play with the scale and cutoff.
But I also felt the feature a bit linear, and I would love to can map cutoff to sensors ( by this 'sensor' I mean a stylus pressure curve ). Especially the black cursor on 'cutoff' here http://wstaw.org/m/2012/03/30/20120330_screenshot_02.jpg with this motion from right to left who really behave as a 0% grain to 100% grain.
The idea is to setup a brush with low pressure show a lot the paper grain , and high pressure cover a lot. Also , other sensors ( curves ) as 'time' or 'speed' could  do interesting result. 

I just noticed also this bug while testing , the pattern get duplicate infinitely in the thumbnail selector  :
http://wstaw.org/m/2012/03/30/20120329_screenshot_01.jpg
From my files on harddrive, nothing changed ( no new pattern files ), and those extra duplicate displayed are flushed after a restart of Krita. 

Thanks for the cool feature again.
Comment 4 animtim 2012-03-29 23:32:54 UTC
Created attachment 70004 [details]
example of wanted textured stroke

example of wanted textured stroke
Comment 5 animtim 2012-03-29 23:33:45 UTC
I've made this little .kra file to show exactly the same thing David asks (just explained differently)

Also same thing about the brush duplicates as I noted on irc, but they are cleaned at restart as David said.
Comment 6 animtim 2012-03-29 23:46:33 UTC
well actually after playing with the black cutoff I see it's not exactly the same thing that I ask/explain, though the desired effect is just pretty similar to what david explains…
Comment 7 animtim 2012-03-30 01:03:40 UTC
Oooops also note in the attached .kra file, I wrote "global opacity of the stroke multiplied with pattern opacity", actually of course the correct math is not to multiply but to substract pattern opacity (or inverted pattern opacity for negative effect) from global opacity.

(Sorry for the mistake, it's late :.P )
Comment 8 Halla Rempt 2012-03-30 07:23:10 UTC
Okay. These things are bugs though, not wishes, so reopening and upgrading. Please add any other issues you find to this bug.
Comment 9 animtim 2012-04-10 17:14:28 UTC
Created attachment 70290 [details]
Textured stroke decomposed with layers

I've made a more precise explanation of how Strength parameter should work, decomposed in layers with details of what each layer represent:

-one layer filled with texture "Metal 01", texture is then desaturated to convert to greyscale, and converted to Alpha using Color to Alpha (white color and threshold=100 selected), set blending mode to "erase".
-one transparency mask on it with a linear gradient to represent desired strength effect
-one layer with simple strokes

Check the attached file.
I hope it'll help you to get it right :.)
Comment 10 animtim 2012-04-10 17:30:18 UTC
Oh and another thing, it may be good to have a checkbox to select if you want to use greyscale values or alpha values of the texture.

Currently it works with both all the time, so I fear it may conflict in some way.
Usually textures are either greyscale based files, or alpha based files, but rarely both.

So I think it would be better to can select it to adapt behavior depending on texture type.
Comment 11 animtim 2012-04-10 20:21:56 UTC
Created attachment 70294 [details]
Textured stroke decomposed with layers (re-uploaded)

Re-upload of previous attachement that was broken file…

Also for a good example of greyscale-based pattern use "Metal 01", and for a good alpha based pattern use "Cross01.pat", both in default pattern set.
Comment 12 animtim 2012-04-10 20:29:21 UTC
Ooops file was too big to be attached, so here is an external link :
http://www.timotheegiet.com/images/krita/TexturedStrokeMath.kra.zip
Comment 13 David REVOY 2012-04-11 06:32:43 UTC
Hey Animtim,
I did tested your file and I think I understood, here my attempt to summarize :
Actual strength parameter is not what you look for and you propose a replacement.

What you propose is more linear and simple as far as I understood :
  -> 0% = pure strokes, no texture
  -> 100% = pure alpha texture, where black in texture are opac and white full alpha
  ... all of this influenced by master flow and opacity, of course. 
  -> for example : 50% = mid alpha textured = where black in texture are 100% opac, and white in texture become black 50% opac.

My point of view :

It makes sens to have a linear texture opacity parameters like the one you describe and I like it. ( I hope I understood it well )  But I also don't think to make it as a total replacement of the actual 'strength' parameters. But more as a new sliders proposed. Actual 'strength' also have effects I do not want to loose and who couldn't be done with a linear opacity slider. Just an opinion, maybe Animtim proposal + cut-off feature would be enough to cover textures effects I have in mind and keep it simple too . Hard to say without trying, I admit having the 'user' limit here :)
Comment 14 animtim 2012-04-11 09:53:19 UTC
Hi David,
That's cool to have your opinion on this;
yes I think you understood exactly what I mean.
("->100% = pure alpha texture, where black in texture are opac and white full alpha" : yes, except if "invert texture" is activated, in which case that's the contrary, of course)

About your fear that current strength have effects that could be losed, I've thought about it too, but came to the conclusion that dynamic "opacity-strength" combined with dynamic black/white cut-off on the pattern could produce any desired result.
What do you think about it boud?
Comment 15 Halla Rempt 2012-04-11 10:10:18 UTC
I'm not longer sure of anything anymore... I also watched http://www.youtube.com
/watch?v=o2bGD6sBgXI and now I'm really confused :-).

Some notes of what I thought would be right:

* strength slider: low: mask out more of the brush mask, high: mask out less of the brush mask. So, the higher the strength, the darker the stroke. But actually, this looks more like the cutoff feature we have now than the strength feature (which I might have completely mis-implemented atm)

* I'm not sure about the difference between grayscale patterns and grayscale + alpha patterns 

* the effect of sensors on any parameter can be tricky. For instance, pressure + cutoff -- I'd be tempted to implement a slider with a midpoint around which the value of the pressure defines the cutoff, instead of the double slider (min/max) we have no. Or the cutoff range could be fixed and the mid point move with the sensor...

* different blending modes: I think that's something I've understood. Then strength will be the opacity value of the blending between brush dab and texture. And the strength will be variable depending on sensors.

One thing is for sure: presets made with the texture option won't be totally portable for some weeks to come :-)
Comment 16 animtim 2012-04-11 11:10:21 UTC
I've watched the video, good to compare…

"* different blending modes: I think that's something I've understood. Then strength will be the opacity value of the blending between brush dab and texture. And the strength will be variable depending on sensors. "

Exactly!

"* the effect of sensors on any parameter can be tricky. For instance, pressure + cutoff -- I'd be tempted to implement a slider with a midpoint around which the value of the pressure defines the cutoff, instead of the double slider (min/max) we have no. Or the cutoff range could be fixed and the mid point move with the sensor..."

I'm not sure to understand what you want to do here… why not "simly" have two dynamic curves that move respectively black and white sliders with pressure or something else? Then the effect can be completly customised/adapted with the curve itself.

"* I'm not sure about the difference between grayscale patterns and grayscale + alpha patterns "

In Greyscale patterns, the pattern is on the light values of the texture file (meaning if you open the file, it's fully opaque with the texture painted on color values)

In Alpha-based patterns (like Cross01.pat), the pattern is already on the alpha channel of the texture file (meaning if you open the texture file, it's semi-transparent, and color used is full black, or in theory can be any color if it's supposed to use alpha and not greyscale, so that's why I think it would be good to can select this in a checkbox).

"* strength slider: low: mask out more of the brush mask, high: mask out less of the brush mask. So, the higher the strength, the darker the stroke. But actually, this looks more like the cutoff feature we have now than the strength feature (which I might have completely mis-implemented atm) "

Indeed, what they call "Depth" looks very similar to what is done with cutoff, then Strength must define "opacity value of the blending between brush dab and texture" as you say above.
And have different blending modes to produce different range of effects…

"One thing is for sure: presets made with the texture option won't be totally portable for some weeks to come :-)"

Of course
Comment 17 Halla Rempt 2012-04-11 12:10:11 UTC
Hm, having a real wash mode with textures is going to be tricky, I think...
Comment 18 Halla Rempt 2012-05-15 07:47:15 UTC
*** Bug 249268 has been marked as a duplicate of this bug. ***