| Summary: | Transform rotate shears/skews pixels, popping, result visibly incorrect | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | needcomp |
| Component: | Tools/Transform | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | dra.w.p.il.e+bugskde |
| Priority: | NOR | Keywords: | triaged |
| Version First Reported In: | 5.2.11 | ||
| Target Milestone: | --- | ||
| Platform: | Microsoft Windows | ||
| OS: | Microsoft Windows | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
what it looks like
Comparison between transform variants and other programs. |
||
Created attachment 187235 [details]
Comparison between transform variants and other programs.
Since the original bug report doesn't mention it: this is about nearest-neighbor interpolation.
It does look like Krita does things differently from other programs, whether that's intentional someone else will have to say. I've attached a comparison image of the following:
1. the source image, unscaled and unrotated.
2. Scaled to 500% and rotated 45° in Krita. Gives funky zig-zags as mentioned in the report.
3. Scaled to 500%, then applied the transform. Then cut and pasted the layer so that the transform tool would let me start a new transform. Then rotated 45°. Less funky result, still some jags though.
4. Manually using the distort mode to try and place the corners in the right places. Pretty tricky because the tool really fights you on this, so I didn't get it entirely correct, but if I did I think it would have given the correct result. So the distort tool is doing something different/better.
5. Is GIMP, using the unified transform tool. Looks as expected.
6. Is Drawpile, using the (only) transform tool. Basically looks the same as GIMP, slight differences probably because it clamps the points to whole pixel coordinates.
This may be solvable without too much reworking, changing the intent of any tools or breaking expectations by just letting you rotate in distort mode. That's basically what GIMP's unified transform tool and Drawpile let you do and it's pretty useful to have in general.
|
Created attachment 187231 [details] what it looks like SUMMARY Using the Rotate feature of the "Transform layer or a selection" tool produces incorrect result. The math appears to be off, causing popping while rotating and incorrect results. Specifically when used together with Scale (up), the tool makes magnified pixels-squares appear sheared, rather than rotated. The shearing direction flips at 45, and then after every 90 degrees. There is no discernible shearing when no scaling is applied, but the image still pops at 45 degrees so the math is likely off in this case too. STEPS TO REPRODUCE 1. Paint several individual pixels using the Pixel Art brush 2. Enable the "Transform layer or a selection" tool for a section containing the pixels 3. Use the tool to scale the section up to 300..500% 4. Use the tool to rotate the section OBSERVED RESULT The pixel squares turn into skewed parallelograms. At 45 degrees the direction of shearing flips abruptly. EXPECTED RESULT The squares remain square throughout the entire 360 degrees of rotation. At no rotation the transformed image pops or changes abruptly. SOFTWARE/OS VERSIONS Windows: Microsoft Windows [Version 10.0.19045.6456] macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION