I realized the spectral mixing of mypaint in krita

Hello everyone, I have successfully calculated new spectral data using KM finder:

7 Likes








It does not yet work properly, however, and mixing it with white does not seem to give the correct result, but there are new possibilities

5 Likes

You will not get this working right, urzeye.
The spectral set Spectral.js uses is as good as it gets.

You won’t find a spectral set which can replace mine.

There could be some improvements but not to the extreme you want.

I know it’s fun to play with and you think you will solve all issues but at the end of the road you only have 3 channels and it can only be used to some extend.

4 Likes

Thank you for your explanation. I believe you are right, and it is indeed impossible to have spectral data that can solve all the problems

1 Like

There’s always a possibility of a breakthrough. In my experience in coding, there is sometimes a breakthrough with regards with my own algorithm. That doesn’t mean much, but I think there is always one.

3 Likes

Hi urzeye, I think this will make you happy.
I updated Spectral.js to use 7 channels (white, cyan, magenta, yellow, red, green and blue) instead of the previous 3 (red, green and blue).

This gives much better results and mix freedom.

The upper is the previous and the lower is the new one.

7 Likes

@urzeye Hi!I found that the above version had issues blending with black:


Thanks for the update, I did some quick tests
Don’t need a black channel? I remember mixbox used black pigment in the new version. I’ve tested the black blending now and still have some issues.It’s not clear to me if this poses a problem.

Also some dark blues shift towards purple when mixed with white (maybe lab was used when calculating the spectrum?)

1 Like

Wow, thank you for the update. It’s great!

1 Like

Hello @TheTwo, did you use the krita I built for testing? I tested it on krita and there seems to be no problem

1 Like

Yes, I forgot to switch to 16bit space above. However, at 16bit, its performance is still not ideal:

1 Like

I retested and there seems to be no problem. I updated the code last night, which may have solved the problem. If the problem persists, it may be a precision issue. I am currently using double and the submitted code is float

1 Like

Currently, the RGB blending mode in krita is float. I use double for my personal needs. I feel that krita’s smudge brush engine requires high data accuracy

1 Like

Hello everyone, I have tested the blending of 81 channel spectral with @raghukamath 's spectral.js 2.0. Which one do you prefer?


Above is spectral.js 2.0, and below is 81 channel spectral

4 Likes

Do you have a link to this 81 channel mixing? I’m curious at what it does.

Which one do you prefer?

2 Likes

This is the source of the data for channel 81: 81 channel

There are things I like about both, I prefer the spectral.js yellow and blue blend which produces a purer green, for the cyan and magenta blend I prefer the 81 channel which produces a purer blue, previously spectral.js would not work in the smudge brush engine, it seems to be due to the colour turning yellow when applying white with too little precision, version 2.0 has fixed this issue, it’s great work, when the colour is white the precision is at 4 decimal places for spectral.js and 8 decimal places for channel 81, I will seek input and if people prefer the results of spectral.js I will update the code to merge the request

Here, the results on the right side are more appealing to me.

Michelist

1 Like

I had to look twice too but there is no right or left side, the differences are stacked on each other.

A color block consists of two gradients.
Some white space between the upper and lower would make things clearer

1 Like

The difference is not that big, choose the faster algorithm

I helped guide Matt DesLauriers implementing that!
@OneDayOfCrypto is my Twitter handle.

It’s a whole different technique.

Spectral.js uses Kubelka-Munk and Matt uses the Weighted Geometric Mean.

They mix visibly different.

It’s not 81 channel, it’s 3 channel, red, green and blue.

Spectral.js uses 7 channels and is capable of more saturated mixing.

Matt’s work is more compute friendly because it has a lot less calculations.

My first prototype was based on the Weighted Geometric Mean but I didn’t like the desaturated colors it produces.

Difference isn’t big. Maybe I would go with the bottom one
Edit I changed my mind, lol top better