Bug 437956 - Switching to other tools after using perspective transformation sometimes trims contents to canvas boundary.
Summary: Switching to other tools after using perspective transformation sometimes tri...
Status: RESOLVED DUPLICATE of bug 418406
Alias: None
Product: krita
Classification: Applications
Component: Filters (other bugs)
Version First Reported In: 4.4.3
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-01 13:26 UTC by Raghavendra kamath
Modified: 2021-06-03 07:49 UTC (History)
2 users (show)

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


Attachments
video showing transform and trim after applying filter (2.51 MB, video/webm)
2021-06-01 13:26 UTC, Raghavendra kamath
Details
video showing transform and trim after applying filter (1.65 MB, video/webm)
2021-06-01 14:33 UTC, Raghavendra kamath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raghavendra kamath 2021-06-01 13:26:58 UTC
Created attachment 138920 [details]
video showing transform and trim after applying filter

SUMMARY
When I apply a filter such as Gaussian blur or desaturation right after applying a transformation, The resulting layer has its content clipped or trimmed to the canvas boundary. The data beyond the canvas boundary is lost. 

STEPS TO REPRODUCE
1. Open Krita and create a new document fill a new paint layer with colour
2. Activate transform tool and transform the layer such that some of it goes beyond the canvas boundary. A perspective transform is most likely to yield the bug. You can also try to transform it while holding Ctrl.
3. Now Immediately trigger a filter such as Desaturate through Keyboard shortcut Ctrl Shift U. Apply the filter.

OBSERVED RESULT
After applying the filter the resulting layer has its content trimmed to what is visible inside the canvas boundary

EXPECTED RESULT
Contents outside the canvas boundary should not be trimmed on applying the filter after transformation

Tested this with 4.4.3 AppImage and nightly AppImage and even from the version in the repository on Fedora. All yield same result.

I am also attaching a video showing the bug

I am marking this critical as this deletes data
Comment 1 Raghavendra kamath 2021-06-01 13:34:42 UTC
Also notice that undoing the actions doesn't bring back the trimmed content. I have to undo until the transformation is undone to get back the original layer.
Comment 2 aiena.makehuman 2021-06-01 14:01:19 UTC
"applying a filter after transformation trims image data to canvas bounds"
-> I can confirm this 

"also noticed undoing the actions doesn't bring back the trimmed content. "
-> this is more complicated. There definitely is a problem but you need one more step beyond the filter step for this to be true.

->Do this test to confirm:

Action flow A:
==============
1) make a small canvas 20x20 px anything
2) fill it with red/any color
3) use transform tool and make out of canvas data
4) apply a gausian blur filter
5) press ctrl +t to move the blurred layer and confirm that it got trimmed but press "Esc" to not commit the move
press ctrl+z now and observe out of bounds data of transform tool present

Action flow B:
=============
1) make a small canvas 20x20 px anything
2) fill it with red/any color
3) use transform tool and make out of canvas data
4) apply a gausian blur filter
5) press ctrl +t to move the blurred layer and confirm that it got trimmed but press "Enter" to commit the move (1 more action after filter)
press ctrl+z 2 times (before move, before gauss blur) now and observe out of bounds data of transform tool present it is clipped.

so your statement is true but not always.
Comment 3 aiena.makehuman 2021-06-01 14:02:39 UTC
correction for point 5 in "Action flow A"

* 5) press ctrl +t to move the blurred layer and confirm that it got trimmed but press "Esc" to not commit the move
press ctrl+z now and observe out of bounds data of transform tool . It is present.
Comment 4 Raghavendra kamath 2021-06-01 14:14:54 UTC
Update: On testing further I noticed that there is no need to apply filter after transformation the area outside the canvas is trimmed immediately.
Comment 5 Raghavendra kamath 2021-06-01 14:33:05 UTC
Created attachment 138921 [details]
video showing transform and trim after applying filter

Attaching another video to show the trimming
Comment 6 Raghavendra kamath 2021-06-01 14:35:55 UTC
After transforming switch to move tool. the trim happens when I switch to other tool immediately after transform.
Comment 7 aiena.makehuman 2021-06-01 15:33:50 UTC
I can reproduce this bug easily with "warp" but not with the other transform modes e.g. scale, cage transform. So trimming on chaning the tool happens only with "warp" mode.
Comment 8 aiena.makehuman 2021-06-01 15:34:15 UTC
*changing
Comment 9 aiena.makehuman 2021-06-01 15:35:48 UTC
sorry i mean with "perspective" transform only this bug of clipping on tool change is present.
Comment 10 Raghavendra kamath 2021-06-01 15:57:22 UTC
The perspective transform can be by means of ctrl key too.
Comment 11 Dmitry Kazakov 2021-06-03 07:49:26 UTC

*** This bug has been marked as a duplicate of bug 418406 ***