I realized the spectral mixing of mypaint in krita

Thanks @urzeye , indeed; I updated my build and recompiled and your commit aab6fe53 really improved situation on my side. It’s not full black anymore, but I still have fringing effect of black.

On autobrush tip, a dark gray injection is visible at low opacity:

With bitmap brush tip, the effect is easier to spot:

The blending mode both works. Here is how looks color strokes (horyzontal) on a “Spectral Over” layer blending mode over rectangular vertical shape in normal blending mode:

2 Likes

Thanks a lot for your feedback. From the formula, it may not happen, but I have fixed it now and used fastpow instead of pow. The performance should have been improved

5 Likes

However, another problem is that when smudge is between 0 and 1, the color mixing is abnormal, and both 0 and 1 show complete spectral color mixing. I guess libmypaint sets that rgb mixing will be used to mix the sampling color and foreground color when smudge is between 0 and 1

1 Like

:+1: Thanks! The problems with injection of black color in the stroke are now fixed, I built and can confirm it. The performances are also much much better now.

Last observation; I saw the feature break the sensor for the Smudge Lenght when turned on (eg. pressure), I made a GIF to demo how moving the curve has no effect on the preview (and the final preset too):

2021-12-20_spectral-mode-breaks-pen-pressure

1 Like

This is just a test. Can you use the brushes in the link to test? They still seem to be normal. Thank you

https://drive.google.com/file/d/13H3S1hr0B6hvThDgHfDT3goNR81xXK3P/view?usp=sharing
https://drive.google.com/file/d/1XgMftpYyNH9yuTx7dYrZnh6J_pyknxlu/view?usp=sharing

1 Like

Oh, you made brushes? Sure, I would like to test them. Unfortunately, your links require a Google account to download them, and I don’t agree with Google Terms of Services, so I don’t have account. Can you upload them somewhere else? Thanks.

2 Likes

OK, I’ve established a new link:

These are the brushes I modified before, and they still seem to be normal

2 Likes

Both are really very good blending brushes. I tested them on blending usual colors and the result is good. But if I attempt to mix with them sort of opposite RGB colors, I obtain very surprising results:

Peek 2021-12-20 15-52

2 Likes

OK, thank you very much. Is the smudge length curve of these two pens still normal? I guess the reason why there is black is that RGB is greater than 1 or less than 0. I have limited their range, but this may also be affected by the smudge algorithm. What about the flat one? Is it normal? Thanks again

1 Like

Both brush presets works fine when the color are not too far on the spectrum (A), very creamy and delicate. But as soon as I test with color opposed on the RGB hue wheel (B) like Red and Cyan, Green and Magenta, I obtain a very dark color mix also.

3 Likes

OK, thanks for the feedback. I have repaired it now. The sensor of the stain curve. I think it may be damaged by the recent update of krita. I have tested two brushes on Windows 11 and they work normally. I also tested the effect of RGBA wet brush in the spectral mixing mode. Although it is a little slow, it still works normally


7 Likes

Thanks for your example, I better see the difference we have. Here after updating and building (from scratch to be sure), I still obtain something like that (under). But it is probably the outdated libraries of my system (Kubuntu 20.04LTS). Let’s wait for the review of a Krita dev. :slightly_smiling_face:

2 Likes

OK, thanks a million for your feedback. They have been of great help to me

1 Like

Here is an AppImage for the convenience of people: krita-5.1.0-prealpha-32121ad-x86_64.appimage — Яндекс.Диск
(it can only run on new versions of Ubuntu 20.04+)

5 Likes

Thanks for the appimage @dkazakov , I retested and I can still reproduce my blending issues ( black on blending two pure opposite RGB colors, and saturated green on cyan with orange… unless it is ‘spectral-expected’?).
Peek 2021-12-22 13-07

2 Likes

krita 5.1.0 good !

2 Likes

Maybe so, there is no abnormal color, such as pure black

1 Like

One more thing, we need to modify the code of “update_ smudge_color” and “apply_smudge” in libmypaint, and put legacy_smudge’s calculation method replaced by the spectral mixing algorithm below, and change the “paint_factor” to “1.0”, so that the mypaint brush can fully support spectral color mixing

3 Likes

Another thing came to my mind. My test was conducted on the canvas of the 16 bit channel depth linergb configuration file. Their effect looks better. According to my feeling, when I use the spectral blending mode to create a gradient, the result is the correct result in the 16 bit channel

1 Like

This looks suspiciously like color calculations are not done in linear RGB space…but I haven’t looked at the code yet.

2 Likes