I realized the spectral mixing of mypaint in krita

I tried to calculate the data of 8 channels and 4 channels. If we want to use the data, I think the result of 8 channels seems to be a good choice, but it is still slow and cannot be used normally

In addition, there is a bigger problem. It seems that the spectral cannot use red and blue to mix purple. Is this because purple is outside the spectral?

differential_evolution step 6081: f(x)= -1.51426
cost metric (smaller = better), weighted cost, actual cost value
red delta:        0.0463960120216 0.000681146181238
green delta:      0.0258002935896 0.00050793989398
blue delta:       0.0758633076857 0.000275432945897
illum xy delta:   0.068839270681 0.000829694345413
bumpiness:        0.00238065861185 2.38065861185
wave variance     0.0 0.0
illum shape diff  0.0369420156997 369.420156997
illum bumpiness   0.792416975269 792.416975269
lum drop rg       0.0550067774099 0.234535237033
lum drop rb       0.827595646852 0.0909722840678
lum drop gb       0.0561567332428 0.236974119352
visual effic      -9.01589746822 -3.00264840902
sd sums to one    1.29010064049 0.0129010064049
mix green delta:  4.01589636172 0.200397014991
mix bl/wh delta:  0.376660523037 0.194077438935
mix prple delta:  0.104478072117 0.10221451566
selected wavelengths:  [438.328508423620065 470.449705587017206 497.101120826019326
 526.158209678789149 554.098509206587323 623.936653271352270
 626.589383351885431 642.063170781271538]
Spectral red is
[0.000142527089540, 0.032567155947501, 0.024489356400817,
 0.146181214716177, 0.001559308342607, 0.724163987530347,
 0.614531396494641, 0.690268180550916]
Spectral green is
[0.000109309769015, 0.022180012784201, 0.807742515200307,
 0.871161276047518, 0.974355591558379, 0.229389183199744,
 0.287397084680610, 0.268296603430407]
Spectral blue is
[0.979288503455153, 0.930229685081636, 0.160382044885262,
 0.029005620758492, 0.031806277288160, 0.009495351705212,
 0.013074493403103, 0.003958696225249]
spectral_to_RGB_m is
[[0.074145673258679, -0.050928052914946, -0.203611696043858,
  -0.294184891051469, 0.024527216954821, 0.681045621880601,
  0.556440146118545, 0.310309115516784],
 [-0.072768610593495, 0.013688758504054, 0.194081153865414,
  0.470805336465469, 0.472182181875378, -0.042542005218770,
  -0.038054032300771, -0.028465462178743],
 [0.596753827877522, 0.432418331533115, 0.100205842039416,
  -0.034224829345238, -0.057502255083883, -0.008473286925217,
  -0.006519411893187, -0.002736369040952]]
`touch halt` to exit early with this solution.
---

differential_evolution step 1000: f(x)= 0.106445
cost metric (smaller = better), weighted cost, actual cost value
red delta:        0.0740721964719 0.000860652057872
green delta:      0.0372397893221 0.000610244125921
blue delta:       0.00668891457811 8.17857846946e-05
illum xy delta:   0.488046986606 0.00220917855006
bumpiness:        0.00308756157135 3.08756157135
wave variance     0.0 0.0
illum shape diff  0.0176061431122 176.061431122
illum bumpiness   0.197893712395 197.893712395
lum drop rg       0.0586099259027 0.242094869633
lum drop rb       0.663699816556 0.0814677737855
lum drop gb       0.0552667528437 0.235088819053
visual effic      -2.91619029717 -1.70768565526
sd sums to one    0.662021234303 0.00662021234303
mix green delta:  0.44789298971 0.211634824571
mix bl/wh delta:  0.351291449817 0.187427706014
mix prple delta:  0.0748685418334 0.0865266096836
selected wavelengths:  [461.654548402819842 502.010582814424254 561.507548675363864
 627.050710255515128]
Spectral red is
[0.013773385643423, 0.041122620900428, 0.071241039492957, 0.926269726615314]
Spectral green is
[0.002381449137520, 0.842094423478893, 0.918341156059444, 0.040492499856219]
Spectral blue is
[0.979669383249793, 0.045754270214948, 0.041293706860343, 0.008653638650361]
spectral_to_RGB_m is
[[-0.004457499629580, -0.365531285237809, 0.287939007801052,
  1.073225671166359],
 [-0.048523313488595, 0.373423954120426, 0.750689106652651,
  -0.074413315443671],
 [1.020191328431544, 0.104394561918329, -0.097800053225181,
  -0.012449104802814]]
`touch halt` to exit early with this solution.
---

1 Like

9 posts were merged into an existing topic: Implementing MixBox mixing for Krita


Is this idea feasible? Can be a naive even fool thinking.

It’s translated version from a Chinese handwriting, maybe hard to read, sorry.

2 Likes

Apart from the licensing question, Mixbox is essentially a lookup table, and the code to generate that table is not part of the package.

In my opinion (which carries not much weight, I now), not having the complete source should preclude inclusion of mixbox into krita, except perhaps as a 3rd party plugin.

1 Like

@halla @Hologram I moved the discussion here since that is a better place for mixbox discussion. So If mix box people see this please go to this thread - Implementing MixBox mixing for Krita

1 Like

Can I move my reply there?

1 Like

This is similar to what mixbox does.

1 Like

Yes,then we will have a gpl version

1 Like

You will have to create the LUT though. The mixbox paper outlines the process. Many of the references are behind a paywall.

1 Like

I did never read mixbox paper at all, a naive reason is I don’t know what will offense there license.
I don’t know law on Patents and Licenses.If you think this thinking is right, maybe I will try to write a independent program to verify feasibility, should be low performance and need optimization.

1 Like

Maybe the code here can help you: GitHub - joeedh/pigment-painter

2 Likes

emmmmm… maybe all problems have been solved?
It is really worth to be tested.

1 Like

If I were to implement it, then I would not use that as a basis, for several reasons. In all fairness, the author does say it is experimental.

Even if Krita can’t implement mixbox, they did explain how to they did it. Combined with some more papers and other resources, some of which they reference, you can recreate mixbox. But you need to do the research to understand the problem you’re trying solve, and you need to do the work to actually write the software.

1 Like

@urzeye @Deevad

artstudio pro now got their own pigment method!
their dev saying it’s not “mypaint way” or “mixbox way”, it’s their own solution!

and csp’s pigment feature will be released in march, still not sure what will csp’s pigment feature looks like, i guess they may have their own solution too

3 Likes

Thanks for the link @mini123

2023-02-16_screenshot_191109

Honestly, good for them, but I find the saturation and lightness of the mix in the video demo very … artificial. I mean more artificial than RGB classic mix. :laughing: This orange is really out of place, and the same for the pink being out of a red hue like that. It makes all the color with highly saturated fringes (see on top/bottom of the blue, and red). But it might work to simulate high-density inks; sometimes, inks can have this sort of hue/sat/val extreme shift while being diluated. I’m curious to see how artists will use that.

5 Likes

Looks just like mixbox to me…

2 Likes

I also found that another developer has solved this problem, but I don’t know whether it will be published
onedayofcrypto .eth/.tez 在 Twitter: “Spectral A javascript library I’m creating based on real pigment mix behaviour (Kubelka-Munk). Don’t know if I will release it but it will be used in my upcoming projects. https://t.co/rxodoPiWqO” / Twitter

8 Likes

I think what he means is that he has no business license to buy mixbox. But the method is still “mixbox-way”. Because I saw him here:

2 Likes

Now everyone is gonna have their own spectral solution. What a arms race.

5 Likes

csp2.0 just update its pigment feature, it seems nice, not sure it use mixbox or not
@urzeye @Deevad @lvr

5 Likes