Bug 447255 - Transform Mask make wrong calculation with perspective with a 90degree turn
Summary: Transform Mask make wrong calculation with perspective with a 90degree turn
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: Tools/Transform (show other bugs)
Version: 5.0.0-beta2
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-20 08:11 UTC by Alexey
Modified: 2021-12-20 16:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
perspective with a 90degree turn (319.74 KB, application/x-krita)
2021-12-20 08:11 UTC, Alexey
Details
with fill layer (68.94 KB, image/jpeg)
2021-12-20 08:11 UTC, Alexey
Details
same t.mask on paint layer (52.03 KB, image/jpeg)
2021-12-20 08:14 UTC, Alexey
Details
Video: The control handle does not want to be moved (953.39 KB, video/mp4)
2021-12-20 14:27 UTC, Ahab Greybeard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2021-12-20 08:11:17 UTC
Created attachment 144704 [details]
perspective with a 90degree turn

Transform Mask make wrong calculation with perspective with a 90degree turn

STEPS TO REPRODUCE
1. Add Transform Mask
2. Get perspective transform
3. Rotate it by 90°
or open attachment ::)

OBSERVED RESULT
Glitched image with perspective transform

EXPECTED RESULT
Normal image with perspective transform

SOFTWARE/OS VERSIONS
Krita 4.4.7, ANGLE, OpenGL, Win7x62 sp1
Krita 5.0.0-beta5, OpenGL, Linux Mint 19.2
Comment 1 Alexey 2021-12-20 08:11:53 UTC
Created attachment 144705 [details]
with fill layer
Comment 2 Alexey 2021-12-20 08:14:10 UTC
Created attachment 144707 [details]
same t.mask on paint layer
Comment 3 Dmitry Kazakov 2021-12-20 08:18:47 UTC
Just a note, this bug is reproducible in Krita 4.4.7, so it is not a regression.
Comment 4 Ahab Greybeard 2021-12-20 14:27:23 UTC
Created attachment 144714 [details]
Video: The control handle does not want to be moved

Confirmed with the Dec 19 5.1.0-prealpha (git 5e7b12a) appimage on Debian 10.
The transform preview is good and the final image, after the transform is finalised, is good for a couple of seconds before the fine detail distortion appears.

While making the transform, there is some difficulty with moving the control handles in the final stages of the 90 degree rortaion. 
They snap back when you try to move them
A video example of this is attached.
Comment 5 Dmitry Kazakov 2021-12-20 16:32:08 UTC
Git commit 634b939438e3cd2f5e16d744ff043bf8fd7d9674 by Dmitry Kazakov.
Committed on 20/12/2021 at 16:28.
Pushed by dkazakov into branch 'master'.

Fix blurry results in 4-point Perspective Transform mode

It looks like if we try to apply the transform in two stages, the
intermediate image gets collapsed into a few-pixels-wide chunk and
therefore causing the final image to be extremely blurry.

M  +30   -29   plugins/tools/tool_transform2/kis_perspective_transform_strategy.cpp
M  +6    -0    plugins/tools/tool_transform2/kis_transform_utils.cpp

https://invent.kde.org/graphics/krita/commit/634b939438e3cd2f5e16d744ff043bf8fd7d9674
Comment 6 Dmitry Kazakov 2021-12-20 16:32:41 UTC
Git commit d2cd5b2024553863eb57273c17c087c3eb905bee by Dmitry Kazakov.
Committed on 20/12/2021 at 16:32.
Pushed by dkazakov into branch 'krita/5.0'.

Fix blurry results in 4-point Perspective Transform mode

It looks like if we try to apply the transform in two stages, the
intermediate image gets collapsed into a few-pixels-wide chunk and
therefore causing the final image to be extremely blurry.
(cherry picked from commit 634b939438e3cd2f5e16d744ff043bf8fd7d9674)

M  +30   -29   plugins/tools/tool_transform2/kis_perspective_transform_strategy.cpp
M  +6    -0    plugins/tools/tool_transform2/kis_transform_utils.cpp

https://invent.kde.org/graphics/krita/commit/d2cd5b2024553863eb57273c17c087c3eb905bee
Comment 7 Dmitry Kazakov 2021-12-20 16:34:12 UTC
Just a note: if you have an existing file with the 4-point perspective transform as a transform mask, please activate transform tool on it and move any handle a little bit. That will update a transform saved in the transform mask, so the blurry effect will go away.