5

Kubelka-Munk 颜料混色理论以及mixbox源码

 2 years ago
source link: https://blog.est.im/2022/stdin-06
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Kubelka-Munk 颜料混色理论以及mixbox源码

Posted 2022-04-21 | stdin

论文发表在 SIGGRAPH Asia 2021 https://scrtwpns.com/mixbox/

传统的 RGB 平均值混色 vs mixbox 混色

stdin-06-01.jpg

原因是光学混色取平均值没问题,很多色彩混出来就是中间的灰色,但是颜料不一样,它是个非线性的。

stdin-06-05.webp

这个非线性的混色,有个精妙的数学公式

8c647992703f69158db62e71cd553ae8db049c35

Mixbox 有源码:https://github.com/scrtwpns/pigment-mixing,本来以为是实现了这个公式,结果它妈的是一个 10MB 的 .cpp 文件。。。直接传入3个参数 (RGB1, RGB2, ratio) 它给你返回一个 RGB 。。。。

好奇这10MB 的向量矩阵怎么来的,就看了下作者讲原理。

这玩意理论 Kubelka-Munk 已经一个世纪前被研究透了,软件里不大规模铺开使用是因为绝大部分图像编辑软件都是R G B 三通道。这个颜料混色需要考虑折射和散射,按照 Haase & Meyer 的模拟理论需要每一个像素都用 72 个通道去模拟 K-S 两个特征值

stdin-06-02.webp

麻烦。这 mixbox 作者就用了4通道去模拟。

stdin-06-03.webp

而且通过巧妙的选择4基色解决了 Kubelka-Munk 色彩空间和 RGB 空间相互转换有溢出的问题。

stdin-06-04.webp

这源码可以研究用,商用需要授权。在 Rebelle 5 Pro 软件里集成了


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK