Krita with clipping (test build)

Tradução Sugerida

Subject: Issue with Krita AppImage (Pre-alpha) on Zorin OS 18

"I am not entirely sure if this is the proper section to report this, but I am currently using Krita with clipping and encountering errors upon launching the application. I am running Zorin OS 18, and every time I open the program, the following two errors appear:

The first is a system security prompt regarding the AppImage:

‘Link to Krita-5.3.0-prealpha-9d4fcc7a20-x86_6…age. Are you sure you want to run this? It is an unknown package. Your computer and data may be vulnerable when running applications from unknown sources. [Run Anyway] — [Cancel].’

Even though I select ‘Run Anyway’ (as I trust the software), another error occurs during the Krita splash screen:

‘ Krita has encountered an internal error:

SAFE ASSERT (krita): “result” in file /home/appimage/persistent/krita/libs/resources/KisResourceCacheDb.cpp, line 2085

Please report a bug to developers!

Press Ignore to try to continue. Press Abort to see developers information (all unsaved data will be lost) ‘

I have to click ‘Ignore’ about five times before the program finally opens. Once launched, it seems to function correctly; however, it did crash unexpectedly once during use. So far, that has been an isolated incident, but the startup errors persist every time.

Any guidance on how to resolve these prompts or if this is a known issue with this specific pre-alpha build would be greatly appreciated."

Thanks a lot for continuing to work on this and for sharing such a detailed breakdown of all the changes. The improvements are useful.

Since this build seems to be based on an older Krita version, I was wondering if you have any plans to update or rebase this mod onto newer versions like 5.3.1 or later? It would be really great to use these features together with the latest official improvements.

Thanks again for your hard work — this kind of contribution makes a huge difference for artists using Krita. Looking forward to future updates!

Hi!

I added a few things from past build (but don’t feel it is fine enough compared to CSP or even very old Illust Studio ui/ux feeling… )

Since i used one of dev 5.3.0 builds this already have many features from this (in unknown state of issues and bugs :D), but maybe it is missing something critical that was added after 9d4fcc7 (but i didn’t notice anything that was critical for me).

You can get new builds for Krita with clipping layers feature (and more) 5.3.0 ver 28 here:

Win:
https://www.dropbox.com/scl/fi/exq54egfwr3nyel8m7wkx/krita_clipping_win_28.zip?rlkey=u4pv90qcz38iunvdxzc9jyi9n&st=wp5m2ph2&dl=1

Linux:
https://www.dropbox.com/scl/fi/i8zz1yv11iye6o0rhibis/krita_clipping_linux_28.zip?rlkey=pj89sn3guypd62gxq563mk7jw&st=o794nhwv&dl=1

Android:
https://www.dropbox.com/scl/fi/pm6th4hhy799ihkyimkek/krita_clipping_android_28.zip?rlkey=o418vvs7wb84fv93h7ojzifuc&st=pt2ozbc1&dl=1

use KRITA_DISABLE_SYNC_EVENTS env variable if have troubles with pigment o plugin or another python plugins ui performance. You can set it in shortcut for krita for example as

win
krita_no_sync

%COMSPEC% /C set KRITA_DISABLE_SYNC_EVENTS=1 && start "" "%CD%\bin\krita.exe"

linux
krita_no_sync.sh

#!/bin/bash
export KRITA_DISABLE_SYNC_EVENTS=1 
./krita-5.3.0-prealpha-9d4fcc7a20-x86_64_clipping_27.AppImage

or whatever, i’m not very familiar with linux : D

For plugins - use manual installation for now, import/export seems to be broken now. (tried to fix)

This build has accelerated clipping projection, i made a sort of caching for clipped base+layer stacks, so when you draw outside of clipped stacks - they should be cached and should not to call unnececery updates. So it should be faster when you spam many layers clipped.

I’m not sure this works fine for animation (for fast tests worked fine, but still need a lot of tests).

Also here is a new blur filter brush modes: adjusted filter kernel to the current brush size (including pressure), accumulated mode and fast box blur mode - so with these changes it should work same fast and with same effect as CSP blur brush:

fast_blur_g

And faster Liqufy from MR 2461 MR 2600 + added a workaround for fixing Warp mode (these changes in master and 5.3.1 broken image when you switch transform tool to Warp mode).

And experimental features:

  • you can enable drawing smooth dabs during same stroke for 8 bit mode same as in CSP:

Krita is very suffering when you draw soft brushes in 8 bit color space. It is not close to how CSP draws and blends dabs during stroke, and not even close to how SAI2 composite everything (same stroke dabs, different strokes, different layers etc). This is caused by quantization error - Krita just stamps dabs in 8 bit space, this produces a banding and retina pattern on overlaped areas, this looks very bad. Usually Krita users set high dithering to hide this, but dithering not very good option too.

smooth_dabs

So i added experimental stroke building and composition in 16 bit temporary device, and then it is blended to main 8 bit. This recreates same result as in CSP/IllustStudio, but still far from SAI 2 (SAI 2 using 16 bit internally obiously). 16 bit temp composition for current stroke is faster that using fully 16 bit mode, and allow to draw less dirty gradients and soft things while still working in laconic and familiar 8 bit space and 8 bit colors. I’m not sure this mode works fine with texture and not fixed color brushes and for other than normal alpha blending modes, so this is jsut for experiments.
Actually, i tried to make even fully RGB8A16 approach (generate opacity dabs masks in 16 bit then composite them in 16 bit temp device, colorize and blend to layer data at 8 bit) this works rather good and almost same as SAI 2, but amount of rework ALL instruments and tools to new color space is just insane. So i guess, CSP-like appoach is fine for a while. :smiling_face_with_tear:

  • for smudge brushes added a “reference border” mode - you can set any layer as reference, set reference number (just same as color number. i was too lazy to do it normaly) and then brush will fill closed areas of ref layer. This featrue called in CSP as “protitude by reference layer” for soft brushes. I have plans to add it for usual brushes too, but first need to find a way how to create selection mask faster than usual flood fill algorithm used in Krita, for now i’m not happy about performance of this thing (in CSP or even in very old Illust Studio it just cost nothing compared to Krita). This now ignores enable/disable param, to disable and use smudge brushes as usual - just set ref layer number to 0. Working ref layer numbers are 2 and higher now (green, yellow and etc). You can also make many ref layers with same color(number) and this will make selection during stroke for all these layers combo, very useful feature when you have a complex line and colorizing it by brushes without any masking, additional selections and etc, i often used it in CSP and IS.

  • i’m still mad from these dirty rectangles during strokes… I don’t know what to do here, if i set barriers for tiled rendering of dabs and strokes batches for them or make large tile - it kills performance… So i decide leave it as it is for now, same as in vanila Krita.

For making merge request - maybe some features could be merged, but clipping is totally hacky, this actually reuses a layer merge system for composition which vanila Krita doesn’t use on fly, this thing absolutely not matches to official code requirements. And i don’t have any time to rework it reusing usual krita layer composition and indirect painting, so these builds - just a playground and concept demos i guess… Maybe in future I or someone else will find enough time and wish to rework clipping normally…

If you found a bug linked with clipping layers or features let me know here, i will try to fix.

@_LimaoComSal try this build. For first issue - i’m not sure that i can help. Try to find how to add appimage to thrusted apps for your system. For second issue - i guess it caused by two krita installation, vanila and clipping builds. In these builds i renamed app name to kritacl, so it will create own configuration files and will store resources in own separated folders. So the second issue could be solved with this new builds. No, roll name back - too many things become broken after renaming including python plugins. Try also set KRITA_SWAP_FILE folder (Settings → Performance → Swap file location) somewhere near krita appimage, Krita spams a lot of these files and never clears them after crash, so it can easy eat all your system temp space (this also applies to the vanilla version)…

5 Likes

Hi!

Thanks again for the new builds and the technical breakdown!

I’m uploading a Work-In-Progress (WIP) piece I’m currently working on using your previous build. Even though I still prefer doing line art in SAI 2 and importing the PSD as a file layer, I do almost all my coloring in Krita now. Your clipping mask feature has been a total lifesaver for my workflow.

It has significantly optimized my layer management and saved me from creating so many unnecessary layer groups. Now my hierarchy is much cleaner:

  • Atmosphere and global lighting: I use a “Pass Through” group with standard “Inherit Alpha” layers.

  • Specific rendering (like hair): I use your Clipping Mask directly. It’s much more intuitive!

Regarding the brush feel, I noticed you mentioned SAI 2. I’ve always wondered why SAI 2 feels so superior for line art—I suspect it’s due to its excellent post-processing on stroke ends (tapering) and stabilization, similar to how FireAlpaca allows users to adjust post-processing intensity. Krita has great stabilizers, but that specific “snappy” feeling of line weight processing is still hard to beat. It would be a dream to see Krita approach that level of UX someday!

Regarding the experimental 16-bit composition, it sounds like a very sophisticated solution to the banding issues. I’ll definitely give it a try in this new build and see how it feels.

I totally understand that the code might be “hacky” for an official merge, but for artists, efficiency is what matters most. I’ll be testing the 26_1 version on Windows and will let you know if I find any bugs.

Thanks again for your hard work!

1 Like

I felt lack of aftertouch tapering in Krtia after years of using, that’s why i made delayed stabiliser.

In this builds i recreated CSP stabilizer almolst as possible as it is, try this please. It has all settings for stabilisation of pressure sensor (fix snappy feel), after touch tapering ("Haraiso / はらい " in terms of CSP), position stabilisation at low and high speeds and strokes combine delay. But i did’t add postdraw smoothering for now (CSP has this feature but i actually never used it, it is faster to fix line by liqufy or mesh cage, and standard stabilisation was always enough for me).

Krita with clipping (test build) - #44 by uvhat description of stab is here.

26_1 has this stab too.

Hi!

Thanks for the detailed explanation! The “aftertouch tapering” and the CSP-style stabilizer you mentioned sound very interesting—it seems we are looking in the same direction regarding that “post-processing” feel.

I haven’t used CSP before, so I’m not familiar with its specific mechanics. My experience comes from 2 years in Krita and recently exploring SAI 2, FireAlpaca, and MediBang. I’ve attached a comparison of the stroke feel between these programs (all at 9px). In Krita, I’m currently testing “Ink Gpen 25” with weighted stabilization. Even so, FireAlpaca and MediBang feel much “smoother,” making it easier to produce “Thin-Thick-Thin” strokes while staying very responsive to the pen tip. SAI 2 is even a step above with a subtle, professional “snappiness” that is hard to describe.

I’ve also uploaded two versions of a WIP piece: the first was done with Krita’s “Basic-5 Size” (which gave me unsatisfactory results), and the second was done after switching to SAI 2. The difference in line quality is quite noticeable to me.

I love Krita for its immense freedom. I’ve even customized my own workflow with AI-assisted scripts—like “RGBLDocker” for color control and mapping ASQW/12 keys to HSL steps for quick adjustments. This “left hand for parameters, right hand for drawing” efficiency is why I’m so committed to Krita.

Since your new stabilizer settings are quite comprehensive, I need some time to truly “feel” them through actual drawing sessions. I’ll be putting the 26_1 build through its paces and will get back to you with detailed feedback once I’ve had enough time to evaluate the results.

Thanks again for your hard work!

1 Like

Hi!

Sorry to bother you again so soon, but I just noticed a small but critical issue while testing the “Delayed Stroke” feature in the new build:

When Delayed Stroke is active, if I try to “Undo” (Ctrl+Z) before the DStab Time finishes, the command doesn’t trigger. I have to wait for the timer to end completely before the undo action becomes responsive. This is quite inconvenient for my workflow, as I often realize a stroke is wrong before it’s even finished and want to undo it immediately.

You should be able to reproduce this easily by setting a longer DStab Time. It would be a huge help if the undo command could interrupt or instantly finalize the current delayed stroke so we don’t have to wait. If possible, please look into fixing this.

Thanks!

I made a fix, try new builds 28. Links in post updated. Krita with clipping (test build) - #85 by uvhat
The only problem is that you can set a different color between strokes during same recording, and until the stroke recording is completely finished new color (or other brush settings) will not be accepted. So change color picker from ctrl to another button (undo and picker share same ctrl key, this is rather annoying) and keep in mind that brush settings will be updated after stroke finishing.

UPD: fixed python plugins, but need to roll app name back.

Huh, another update. :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage: :high_voltage:

Finally masks and layers with clipping enabled is fixed ( i guess ). Should works now with clipped layers too…

Please try to test different cases for transparency masks, filter masks and other masks, and styles (FX) effects (this maybe slow, but i found that vanila Krita is ~ same slow with styles for inherint alpha layers too) and their combo with and without combo of usual clipped layers. Earlier masks and FX was completely disabled because they caused a heavy dirty rectangles and artifacts during stroke or any update actions.

Windows build:
https://www.dropbox.com/scl/fi/40lm4xndwygfczex8385c/krita-x64-5.3.0-prealpha_clip_test_0_30.zip?rlkey=2e0ywpbjvri4i5rvvtyafzacn&st=jgxqvddu&dl=1

Linux build:
https://www.dropbox.com/scl/fi/iaanqlqngc6uytyv7g96k/krita-5.3.0-prealpha-9d4fcc7a20-x86_64_clipping_30.AppImage?rlkey=yuxd0koron2atmzxrzv13zwyv&st=ojvci27r&dl=1

Android
https://www.dropbox.com/scl/fi/ka0mmy8s20qgzgidtq52r/krita-arm64-v8a-5.3.0-prealpha-test-clipping-debug-30.apk?rlkey=d6g0n4fo9ijrmmsr1msvmnr86&st=sqfbfp80&dl=1

Maybe if clippijng finally works fine enough now for most cases i will try to cleanup everything and make a merge request to master.

2 Likes

That’s perfect timing! I was just about to report that Transparency Masks on clipped layers weren’t refreshing the canvas immediately, but it seems you’ve already caught and fixed it in this 0_30 build.

I’m downloading the new version now. It would be amazing if this clipping feature finally gets merged into the master branch! I’ll continue using it in my daily work, and if I run into any more bugs with masks or layer styles, I’ll let you know here.

Thanks again for the update!

I have a question: Do you have a repository where you’ve stored the code for everything you’re implementing?

1 Like

No. I just included diffs to specified comit state (9d4fcc7) repo in builds (in last post i forgot to include it, i will add diff separately).

Is 5.3.1 stable enough now? I want to make patch for current 5.3.1 release.

Krita 5.3.1 is today as stable as it was it the first day. But let’s say it so, there are some reports about issues with the resource database (missing bundles) when Krita is starting up on Windows machines. I don’t have this issue and although it is a noticeable amount of users reporting it, we had other issues back in time where the reporting users overrun the forum, and it is not that severe right now.

Michelist

Hi!

I’ve been testing your new stabilizer for a while now, and the experience is very impressive! I want to share some feedback on how it feels.

I’m uploading a comparison of the line art done with your latest build versus SAI 2, along with the specific brush curve settings I’m currently using. Your effort on the “Aftertouch Tapering” and the new stabilizer has really paid off—the lines feel much more controlled and “snappy” now. It’s definitely getting closer to that professional feel I was looking for.

I’ll continue to use this version in my workflow. If I encounter any bugs or have more observations while drawing, I’ll let you know. Thanks again for your amazing work!

2 Likes

Out of curiosity, why don’t ya add this to the existing clipping feature MR?
Plus that, assuming how people are happy with the extras, would be very nice to have it officially

EDIT: oh nvm, you plan to, awesome!

Um, that’s a separate thing. I wish I can write a custom report denoting that’s separate from clipping. Not saying that feature is a bad thing or anything against you, just not related to this thread.