Bug 411457 - Change saturation for rerference images almost freezes Krita
Summary: Change saturation for rerference images almost freezes Krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Reference Images (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-30 21:46 UTC by Karl Ove Hufthammer
Modified: 2020-08-06 17:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2019-08-30 21:46:53 UTC
SUMMARY
When one tries to (quickly) change the saturation of a reference image, Krita almost freezes (i.e., it seems to completely freeze, but *eventually* catches up).


STEPS TO REPRODUCE
1. Create or open an image.
2. Select the ‘Reference Images’ tool.
3. Add a reference image.
4. Click and drag the ‘Saturation’ slider for the reference image to the left and right a few times (without letting go).

OBSERVED RESULT
Krita seems to freeze (for quite a few seconds).


EXPECTED RESULT
The saturation of the reference image should be instantly updated, with no freezes or changes in responsiveness.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20190824
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.61.0
Qt Version: 5.13.0
Kernel Version: 5.2.9-1-default
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-2500 CPU @ 3.30GHz
Memory: 15,6 GiB


ADDITIONAL INFORMATION
Changing the *opacity* of the reference image works fine, with no freezes or delays.
Comment 1 Halla Rempt 2019-08-31 07:31:07 UTC
Hm... What's the size of the image and of ther eference images? I tried on a 1600x1200 image with three reference images, and everything was pretty much instant.
Comment 2 Karl Ove Hufthammer 2019-08-31 08:01:47 UTC
The size of the reference image seems to matter most. For small reference images, everything works fine. For large ones (either rescaled in Krita or shown at the original size), Krita slows to a crawl. Here’s a (very large) example image (tested on a 1600 × 1200 document):

https://unsplash.com/photos/MN251xZ9mBk/download?force=true

Changing the opacity is near instant, but changing the saturation is *extremely* slow. And when you drag the slider left and right a few times (without letting go of the mouse button), Krita seems to want to calculate all intermediate saturation values, not just the final one (?), and basically freezes for a *long* time.
Comment 3 wolthera 2019-09-21 15:14:59 UTC
I can confirm here with an A4 sized reference image.
Comment 4 wolthera 2020-08-06 17:36:55 UTC
Git commit 63689a3efa04a0757030b95c16e6d0c479e3b7df by Wolthera van Hövell tot Westerflier.
Committed on 06/08/2020 at 17:34.
Pushed by woltherav into branch 'master'.

Add signal compressor in the reference image tool to prevent freezes.

The saturation slider takes up quite a bit of computation time, so
we use the techniqu of using a signal compressor to reduce the amount
of changes being calculated.

M  +13   -2    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImagesWidget.cpp
M  +2    -0    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImagesWidget.h

https://invent.kde.org/graphics/krita/commit/63689a3efa04a0757030b95c16e6d0c479e3b7df
Comment 5 wolthera 2020-08-06 17:37:07 UTC
Git commit a7679986344a2e47b4d334d09a923e4a5e44d012 by Wolthera van Hövell tot Westerflier.
Committed on 06/08/2020 at 17:36.
Pushed by woltherav into branch 'krita/4.3'.

Add signal compressor in the reference image tool to prevent freezes.

The saturation slider takes up quite a bit of computation time, so
we use the techniqu of using a signal compressor to reduce the amount
of changes being calculated.

M  +13   -2    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImagesWidget.cpp
M  +2    -0    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImagesWidget.h

https://invent.kde.org/graphics/krita/commit/a7679986344a2e47b4d334d09a923e4a5e44d012