Sharpness brush option rework
ClosedPublic

Authored by vanyossi on Oct 29 2017, 12:37 PM.

Details

Summary

Strengh controls how much sharpness is applied to the pixel data:
Soft controls the edge grays gradation.

Soft Edge acts on the non sharpened edges. If Sharpen strenght is set to 100, Soft will apper to do nothing, Soft Edge is more designed to fine tune the amount of transparent pixels. The difference with Strenght is that, Strenght clips to black from opacity and Softness clips to transparent pixels from alpha value.

Default behavior: Strengh 100%, soft 0 (this is the old behaviour)

  • original writeup

With old sharpness you can only adjust threshold manually via slider in the setting, Strength doesn't seems to do anything.

With new sharpness you can use sensors to dynamically change threshold, plus you can check "soft mode" and you can set "soft edge" to get more soft edges (see pic).

Test Plan
  1. find out why "soft edge" value loading as 40 (done: values were not absolute because max strnght made most tips dissapear. this is now fixed)
  2. proper defaults to support old brush presets (Done)
  3. better valuables\function names, tooltips, etc (Done)

4)* rework of "soft edge" (done)

  1. Add working save (Done)
  2. Rename functions and values (Done)

Missing! Test load of old SHARPNESS_FACTOR enabled presets. but I lack some of those

  1. Check all values are loaded correctly on defaults and saved

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
radianart created this revision.Oct 29 2017, 12:37 PM
radianart updated this revision to Diff 21844.Nov 3 2017, 4:41 PM

Updated diff for multithreaded update. Also fixed problem with default value.

woltherav added a subscriber: woltherav.EditedNov 3 2017, 5:10 PM

There's uh, a bit of a problem that it breaks all the existing pixel presets(so load the strength as 0 or something??? No wait, that won't work either because then it loses the subpixel precision removal that the single pixel brush needs).

It loads the old threshold as 40 because all pre-existing presets have that value saved into it, so it might actually be wiser to load that value as 0 to 100 and to just scale it down and up in the formula.

woltherav requested changes to this revision.Nov 3 2017, 5:15 PM

This needs more work. The idea is good, but as long as pixel1 is not working I'd be very upset if it got in. My suggestion is to make the subpixel precision disabling a toggle for this one.

This revision now requires changes to proceed.Nov 3 2017, 5:15 PM
woltherav added a comment.EditedDec 29 2017, 7:45 PM

Testing again after dmitry's multithread fixes: This is a lot better, but the softness slider doesn't load anything from the preset, nor does the softness toggle get loaded. These things need to be saved before it can go into master.

plugins/paintops/libpaintop/kis_pressure_sharpness_option.cpp
58

the threshold/softness slider will also need to have m_softness set, otherwise it won't save.

woltherav added inline comments.Dec 29 2017, 7:47 PM
plugins/paintops/libpaintop/kis_pressure_sharpness_option.cpp
58

oh, also change the 0 to 100, that way new brushes get loaded with this set to 100 and there's nothing funny happening with the brushes.

Restricted Application added a reviewer: Krita. · View Herald TranscriptApr 9 2019, 1:38 PM
Restricted Application added a project: Krita. · View Herald Transcript

Could not update this revission as it is not mine. Im continuing the work on this here https://phabricator.kde.org/D20423

  • Softness Controls alpha borders
  • Strenght controls how soon dark pixels clip to black
  • Pixel brushes work as normal

Missing

  • save settings doesn't work

Could not update this revission as it is not mine. Im continuing the work on this here https://phabricator.kde.org/D20423

  • Softness Controls alpha borders
  • Strenght controls how soon dark pixels clip to black
  • Pixel brushes work as normal

    Missing
  • save settings doesn't work

The "Commandeer Recision" action should allow you to take over this revision.

vanyossi commandeered this revision.Apr 10 2019, 2:47 PM
vanyossi added a reviewer: radianart.
vanyossi updated this revision to Diff 55906.Apr 10 2019, 2:53 PM
vanyossi edited the summary of this revision. (Show Details)
vanyossi edited the test plan for this revision. (Show Details)

Now I know of the Commandeer revision option. Abandoning the other diff.Updating with the contents of the other

vanyossi marked 2 inline comments as done.Apr 10 2019, 2:54 PM

new Sharpness sample

vanyossi updated this revision to Diff 55919.Apr 10 2019, 3:56 PM
vanyossi edited the test plan for this revision. (Show Details)

This Last change fixes all bugs with saving and loading.

vanyossi updated this revision to Diff 55920.Apr 10 2019, 3:58 PM

Forgot to delete a comment :s

woltherav accepted this revision.Apr 10 2019, 10:40 PM

code wise this looks good to me :)

This revision is now accepted and ready to land.Apr 10 2019, 10:40 PM
This revision was automatically updated to reflect the committed changes.