Implementing Kubelka-Munk like Krita to mix colours (color) like paint

前端 未结 3 1769
猫巷女王i
猫巷女王i 2020-12-03 06:19

Is anyone aware of where to find or implement the Kubelka-Munk function to mix colour like natural paint? Emanuelle Tamponi implemented this function in Krita, an open sourc

相关标签:
3条回答
  • 2020-12-03 06:47

    Feel free to re-use the code we have in krita. It's in calligra/krita/plugins/extensions/painterlyframework. It does need the pigment library as a back-up, but I guess you can easily abstract away from that.

    Note however that the code is under the GPLv2+ license. If you reuse the code or the illuminants files your code also need to be GPL.

    (for more info, please contact me -- boud@valdyas.org or boud on #krita on irc.freenode.net, I'm the maintainer for Krita).

    0 讨论(0)
  • 2020-12-03 06:49

    Here's an implementation I created that uses a simplified Kubelka-Munk model. It assumes assumes all colors have the same concentration when blending and that all colors are opaque. If it is useful feel free to use it in whatever manner you wish.

    https://github.com/benjholla/ColorMixer

    0 讨论(0)
  • 2020-12-03 06:52

    There is not enough information provided by RGB values alone to perform a true Kubelka-Munk computation, as you need both absorbance and scattering curves across the visible spectrum. Instead, you could generate representative reflectance curves from RGB values, and then use the reflectance information to perform the subtractive mixture, for example, by computing the weighted geometric mean of the two reflectance curves.

    0 讨论(0)
提交回复
热议问题