Bug 420811

Summary: Aliasing problem with Perspective tool + nearest neighbor filter
Product: [Applications] krita Reporter: Xavier Dole <elodreivax>
Component: Tools/TransformAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version: 4.2.9   
Target Milestone: ---   
Platform: Mint (Debian based)   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Left : image before transformation (hard edges) - Right : image after transformation (anti aliasing effect)

Description Xavier Dole 2020-04-30 16:08:26 UTC
Created attachment 128034 [details]
Left : image before transformation (hard edges) - Right : image after transformation (anti aliasing effect)

SUMMARY
Transforming an image with "Transform tool-> Perspective-> Filter: Nearest Neighbor should not produce an anti aliasing effect, but it is.

STEPS TO REPRODUCE
1. Load an image with hard edges
2. Select the Transform tool
3. Choose "Perspective" in the tool options
4. Choose "Filter: Nearest Neighbor
5. Clic the image
6. Move one of the four small squares at the corners of the image to distort it
7. Press enter
8. Zoom on the image.


OBSERVED RESULT
Despite the filter "nearest neighbor", an anti aliasing effect has been added.

EXPECTED RESULT
No anti aliasing effect (hard edges)

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Linux Mint 19.3
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I have attached an image as an example:
- Left : image before transformation (hard edges)
- Right : image after transformation (anti aliasing effect)
Comment 1 Dmitry Kazakov 2021-05-24 08:28:38 UTC
I will take this bug :)
Comment 2 Dmitry Kazakov 2021-05-25 10:50:06 UTC
Git commit e0b44f443baa6b9baf1b85432e587865da05819e by Dmitry Kazakov.
Committed on 25/05/2021 at 10:49.
Pushed by dkazakov into branch 'master'.

Fix Nearest Neighbour filter of the perspective transform mode

Perspective transform mode should use nearest neighbour when user
requests it.

M  +50   -4    libs/image/kis_perspectivetransform_worker.cpp
M  +9    -1    libs/image/kis_perspectivetransform_worker.h
M  +7    -2    plugins/tools/tool_transform2/kis_transform_utils.cpp

https://invent.kde.org/graphics/krita/commit/e0b44f443baa6b9baf1b85432e587865da05819e
Comment 3 Dmitry Kazakov 2021-06-01 13:15:20 UTC
Git commit ac4eb8ceadae7a926c835e8afc45b40de482218f by Dmitry Kazakov.
Committed on 01/06/2021 at 12:09.
Pushed by dkazakov into branch 'krita/4.3'.

Fix Nearest Neighbour filter of the perspective transform mode

Perspective transform mode should use nearest neighbour when user
requests it.

M  +50   -4    libs/image/kis_perspectivetransform_worker.cpp
M  +9    -1    libs/image/kis_perspectivetransform_worker.h
M  +7    -2    plugins/tools/tool_transform2/kis_transform_utils.cpp

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