Bug 512577 - [5.3] Transform masks with liquify no longer show correctly after Liquify Performance Commit
Summary: [5.3] Transform masks with liquify no longer show correctly after Liquify Per...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Android Android 14.x
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2025-11-25 01:55 UTC by Door1
Modified: 2026-03-03 14:56 UTC (History)
1 user (show)

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


Attachments
Open this .kra in 5.2.13 and latest nightly to see the difference (414.02 KB, application/x-krita)
2025-11-25 01:55 UTC, Door1
Details
Image showing the rendering difference (295.33 KB, image/png)
2025-11-25 01:57 UTC, Door1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Door1 2025-11-25 01:55:19 UTC
Created attachment 187139 [details]
Open this .kra in 5.2.13 and latest nightly to see the difference

SUMMARY
https://invent.kde.org/graphics/krita/-/merge_requests/2461

After this merge request was committed, layers with a Transform Mask with liquify no longer render correctly as they once did. In other words, anyone opening their Krita documents made before this MR will now see unexpected changes to how their layer looks.

See the attached files in this bug report to see the difference.

STEPS TO REPRODUCE
1. In 5.2.13, put a transform mask on your paint layer and use liquify on the mask.
2. Now open your file in the latest nightly with the Liquify Performance MR.

OBSERVED RESULT
The rendered result looks different than what you originally saw.

EXPECTED RESULT
The look from 5.2.13 should be preserved.

SOFTWARE/OS VERSIONS
Android 14
arm64
Krita 5.3 nightly
git e7dd32ae (Nov. 24, 2025)
Comment 1 Door1 2025-11-25 01:57:40 UTC
Created attachment 187140 [details]
Image showing the rendering difference
Comment 2 Dmitry Kazakov 2026-03-03 14:53:41 UTC
Git commit cf5341a73aa54fd4584122f629d80f91b84278e2 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:29.
Pushed by dkazakov into branch 'master'.

Revert "Fix offsets in Liquify transform tool"

This reverts commit d7f78faa6c0d186e4faaa01141291ae750225617.

M  +5    -17   libs/image/kis_grid_interpolation_tools.h
M  +6    -16   libs/image/kis_liquify_transform_worker.cpp

https://invent.kde.org/graphics/krita/-/commit/cf5341a73aa54fd4584122f629d80f91b84278e2
Comment 3 Dmitry Kazakov 2026-03-03 14:53:44 UTC
Git commit 265ea46eae45f92753f307399e847c972acfa628 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:29.
Pushed by dkazakov into branch 'master'.

Fix rendering of nearly-perfect Liquify mask squares

Before this commit, slightly uneven, but nearly perfectly
square grid parts would still be processed using the polygon
or the square copying code. This commit ensures that only true perfect
squares are processed using that code.
The squares must be both square and pixel aligned to a tolerance of
0.001. This tolerance is big enough to cover the "pixel alignment"
fix that adjustAlignedPolygon() introduces.

M  +14   -0    libs/global/kis_algebra_2d.h
M  +16   -14   libs/image/kis_grid_interpolation_tools.h

https://invent.kde.org/graphics/krita/-/commit/265ea46eae45f92753f307399e847c972acfa628
Comment 4 Dmitry Kazakov 2026-03-03 14:53:46 UTC
Git commit 15c8ac68f6cbb30f9e693c3504ca75faadf757e4 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:29.
Pushed by dkazakov into branch 'master'.

Fix calculations of subgrids in GridIterationTools

Before this commit, the GridIterationTools subgrids calculations
assumed that the first column and row of the grid are pixelPrecision
tall/wide. This commit fixes that assumption, and changes the
calculations to have grid lines on the pixels divisable by
pixelPrecision.

M  +7    -7    libs/image/kis_grid_interpolation_tools.h

https://invent.kde.org/graphics/krita/-/commit/15c8ac68f6cbb30f9e693c3504ca75faadf757e4
Comment 5 Dmitry Kazakov 2026-03-03 14:53:52 UTC
Git commit 32acf5d57a138e88597e9e522226d913c2774462 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:29.
Pushed by dkazakov into branch 'master'.

Add a margin to bounds when painting in Liquify

Before this commit, only the parts that were actually changed were added
to the accumulated brush strokes bounds. This commit adds pixelprecision
on all sides, because "squares" of the grid are changed
even when just one point is changed. Adding a margin of pixelPrecision
makes sure that the points around the actually changed points are marked
as if they changed too, allowing for correct painting of those
"squares".

M  +2    -2    libs/image/kis_liquify_transform_worker.cpp

https://invent.kde.org/graphics/krita/-/commit/32acf5d57a138e88597e9e522226d913c2774462
Comment 6 Dmitry Kazakov 2026-03-03 14:53:54 UTC
Git commit ca32b67131100785350e8837f9e578c73dbd5e6d by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:29.
Pushed by dkazakov into branch 'master'.

Process squares in the correct order in Liquify

Before this commit, the squares to copy in the Grid Iteration Tools
would be processed at the end. This commit changes it so they are always
processed before any uneven "square". That ensures that all the squares
would be processed in the same order as they were before any performance
improvements (before merging), except that the consecutive squares
are merged (since they don't need any special order and can be processed
all at once).

Since the Liquify uses round brushes, the area of squares to merge would
typically have a lot of diagonal edges, therefore the KisRegion merger
would merge them into rows anyway, so while this will indeed reduce the
performance benefits we get from merging in comparison to the state from
before this commit, it should not reduce it drastically in practice.

M  +20   -3    libs/image/kis_grid_interpolation_tools.h

https://invent.kde.org/graphics/krita/-/commit/ca32b67131100785350e8837f9e578c73dbd5e6d
Comment 7 Dmitry Kazakov 2026-03-03 14:54:00 UTC
Git commit 7f91b993e4cbabb4f599acda8db73d542e2e0f16 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:29.
Pushed by dkazakov into branch 'master'.

Add a margin to bounds when reading a liquify mask

Before this commit, only the points that were actually changed were added
to the accumulated brush strokes bounds when reading a Liquify transform mask from XML.
This commit adds pixelPrecision
on all sides, because "squares" of the grid are changed
even when just one point is changed. Adding a margin of pixelPrecision
makes sure that the points around the actually changed points are marked
as if they changed too, allowing for correct painting of those
"squares".

M  +2    -0    libs/image/kis_liquify_transform_worker.cpp

https://invent.kde.org/graphics/krita/-/commit/7f91b993e4cbabb4f599acda8db73d542e2e0f16
Comment 8 Dmitry Kazakov 2026-03-03 14:55:50 UTC
Git commit 17f54aef9cf54cb81f88d749f14e70565179ea00 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:55.
Pushed by dkazakov into branch 'krita/6.0'.

Revert "Fix offsets in Liquify transform tool"

This reverts commit d7f78faa6c0d186e4faaa01141291ae750225617.

M  +5    -17   libs/image/kis_grid_interpolation_tools.h
M  +6    -16   libs/image/kis_liquify_transform_worker.cpp

https://invent.kde.org/graphics/krita/-/commit/17f54aef9cf54cb81f88d749f14e70565179ea00
Comment 9 Dmitry Kazakov 2026-03-03 14:55:53 UTC
Git commit 617e65adfcb0604cd26f5904431e70731d6e4a79 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:55.
Pushed by dkazakov into branch 'krita/6.0'.

Fix rendering of nearly-perfect Liquify mask squares

Before this commit, slightly uneven, but nearly perfectly
square grid parts would still be processed using the polygon
or the square copying code. This commit ensures that only true perfect
squares are processed using that code.
The squares must be both square and pixel aligned to a tolerance of
0.001. This tolerance is big enough to cover the "pixel alignment"
fix that adjustAlignedPolygon() introduces.

M  +14   -0    libs/global/kis_algebra_2d.h
M  +16   -14   libs/image/kis_grid_interpolation_tools.h

https://invent.kde.org/graphics/krita/-/commit/617e65adfcb0604cd26f5904431e70731d6e4a79
Comment 10 Dmitry Kazakov 2026-03-03 14:55:55 UTC
Git commit 72b29ed32d229659c1f16ff40cf7bac5461ce893 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:55.
Pushed by dkazakov into branch 'krita/6.0'.

Fix calculations of subgrids in GridIterationTools

Before this commit, the GridIterationTools subgrids calculations
assumed that the first column and row of the grid are pixelPrecision
tall/wide. This commit fixes that assumption, and changes the
calculations to have grid lines on the pixels divisable by
pixelPrecision.

M  +7    -7    libs/image/kis_grid_interpolation_tools.h

https://invent.kde.org/graphics/krita/-/commit/72b29ed32d229659c1f16ff40cf7bac5461ce893
Comment 11 Dmitry Kazakov 2026-03-03 14:56:01 UTC
Git commit 27a8a0838f72aca79146af9445fd3c6675285956 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:55.
Pushed by dkazakov into branch 'krita/6.0'.

Add a margin to bounds when painting in Liquify

Before this commit, only the parts that were actually changed were added
to the accumulated brush strokes bounds. This commit adds pixelprecision
on all sides, because "squares" of the grid are changed
even when just one point is changed. Adding a margin of pixelPrecision
makes sure that the points around the actually changed points are marked
as if they changed too, allowing for correct painting of those
"squares".

M  +2    -2    libs/image/kis_liquify_transform_worker.cpp

https://invent.kde.org/graphics/krita/-/commit/27a8a0838f72aca79146af9445fd3c6675285956
Comment 12 Dmitry Kazakov 2026-03-03 14:56:03 UTC
Git commit d55985520fc1ce21a7451223017d52195e8ca423 by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:55.
Pushed by dkazakov into branch 'krita/6.0'.

Process squares in the correct order in Liquify

Before this commit, the squares to copy in the Grid Iteration Tools
would be processed at the end. This commit changes it so they are always
processed before any uneven "square". That ensures that all the squares
would be processed in the same order as they were before any performance
improvements (before merging), except that the consecutive squares
are merged (since they don't need any special order and can be processed
all at once).

Since the Liquify uses round brushes, the area of squares to merge would
typically have a lot of diagonal edges, therefore the KisRegion merger
would merge them into rows anyway, so while this will indeed reduce the
performance benefits we get from merging in comparison to the state from
before this commit, it should not reduce it drastically in practice.

M  +20   -3    libs/image/kis_grid_interpolation_tools.h

https://invent.kde.org/graphics/krita/-/commit/d55985520fc1ce21a7451223017d52195e8ca423
Comment 13 Dmitry Kazakov 2026-03-03 14:56:09 UTC
Git commit 3fd814f2065afe0c94ee65c6a000c8156898051d by Dmitry Kazakov, on behalf of Agata Cacko.
Committed on 03/03/2026 at 14:55.
Pushed by dkazakov into branch 'krita/6.0'.

Add a margin to bounds when reading a liquify mask

Before this commit, only the points that were actually changed were added
to the accumulated brush strokes bounds when reading a Liquify transform mask from XML.
This commit adds pixelPrecision
on all sides, because "squares" of the grid are changed
even when just one point is changed. Adding a margin of pixelPrecision
makes sure that the points around the actually changed points are marked
as if they changed too, allowing for correct painting of those
"squares".

M  +2    -0    libs/image/kis_liquify_transform_worker.cpp

https://invent.kde.org/graphics/krita/-/commit/3fd814f2065afe0c94ee65c6a000c8156898051d