Bug 462193

Summary: Saturation option in brush editor with weird behavior.
Product: [Applications] krita Reporter: RamonMiranda <mirandagraphic>
Component: Brush enginesAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, griffinvalley
Priority: NOR Keywords: triaged
Version First Reported In: 5.1.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Saturation behavior . Is this ok?

Description RamonMiranda 2022-11-24 12:01:51 UTC
Created attachment 153991 [details]
Saturation behavior . Is this ok?

SUMMARY
Saturation in brush editor seems to not be ok. I attach one image.



STEPS TO REPRODUCE
1. Select the palette pixel 32 and the color Tahiti Orange.
2. Go to brush editor and activate Saturation in the Color section
3.  Activate Pressure sensor and test a brushtroke with maximum pressure  

OBSERVED RESULT
The saturation Arrives to Red values R=223 G=0 B=0

EXPECTED RESULT
I would expect a pure orange .Like displacing manually my hand in X axis inside the Advanced color selection in Disc with Square box for selecting color in HSV model.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I have tested in Krita 5.1.1 and NExt. Krita 5.2 prealpha 587a231 also Krita 4 so maybe this is old or i am missing something.
Comment 1 wolthera 2023-01-12 12:17:28 UTC
Huh, strange.

I can confirm with the Krita Version: 5.2.0-prealpha (git 5c98a72) Appimage with Qt 5.15.7

What *might* be going on here is that the HSV filter has been set to be unbounded for use with floating point spaces, but the behaviour in floating point spaces seems incorrect as well: green and blue values become *negative*.
Comment 2 Dmitry Kazakov 2023-01-19 12:49:42 UTC
Git commit 5e666c0df9571b9ce7b8ee5edf5c626dbf4802dd by Dmitry Kazakov.
Committed on 19/01/2023 at 12:49.
Pushed by dkazakov into branch 'master'.

Use "new" HSV algorithm in the brush option

The "new" algorithm in more stable and gives a bit more expected
results. The patch changes the algorithm unconditionally.
Theoretically, we might want to make it configurable, but
I don't really want to overload teh already complicated GUI.

M  +9    -0    plugins/paintops/libpaintop/kis_pressure_hsv_option.cpp

https://invent.kde.org/graphics/krita/commit/5e666c0df9571b9ce7b8ee5edf5c626dbf4802dd