Mixing Paint!
With Computers!
Let’s talk about colors
Let’s talk about colors
Let’s talk about colors
Colors in Code
Colors as combination of Red, green, blue lights
RGB Model
Mixing Colors
Mixing Colors
Mixing Colors
Mixing Colors
Mixing Colors
Mixing Colors
Mixing Colors
R: 1.0
G: 0
B: 0
R: 1.0
G: 1.0
B: 0
R: 1.0
G: 0.5
B: 0
Mixing Colors?
R: 0
G: 0
B: 1.0
R: 0.5
G: 0.5
B: 0.5
R: 1.0
G: 1.0
B: 0
So how does mixing paint work?
• Let’s talk about physics
Visible Light Spectrum
380 nm 750 nm
Subtractive color
CMYK color model
Mixing Colors Again
C: 1.0
M: 1.0
Y: 0
C: 0
M: 0
Y: 1.0
C: 1.0
M: 1.0
Y: 1.0
Now what?
• Other color spaces?
• Need to convert to RGB to display on screen
Let’s try physics
Kubelka-Munk theory
• Returns reflectance of light for a layer of pigment on a surface
Kubelka-Munk theory
White
light
Kubelka-Munk theory
White
light
Scattering,
Absorption,
Etc.
Kubelka-Munk theory
White
light
Scattering,
Absorption,
Etc. Colored light
Kubelka-Munk theory
Case Study: Krita Color Blending
Case Study: Krita Color Blending
Removed in 2012 :<
Kubelka-Munk theory
• It’s complicated to implement.
• Needs information not provided by RGB
• Physically accurate (to a point)
• Can we do better?
Case Study: Paper (iPad App)
Summary
• Mixing colors is complicated
• Color representation in computers not optimized for blending
colors
• You can use physics!
• Or do it all manually
• To get realistic (or not realistic) color blending
Thank you!
Diana Liao
@dmliao
Extras
• Stuff that didn’t make it into the 10 minutes, and other links
CMYK?
• So the CMY part stands for Cyan, Magenta, and Yellow
• K = Key (Black)
• Avoids using up all your colored inks when printing B&W
Color is not intuitive
Kubelka-Munk theory
(1–R)²/2R = k/s = Ac/s
Where:
R = reflectance
k = absorption coefficient
s = scattering coefficient
c = concentration of the absorbing species
A = absorbance
Solve for R and convert reflectance to RGB
References
• http://vis.computer.org/vis2004/DVD/infovis/papers/gossett.pdf -
a paper for using different color spaces to mix colors, which I
didn’t have time to go over
• https://www.youtube.com/watch?v=lyLPZDVdQiQ – video for
Krita’s paint mixer
• http://www.fastcompany.com/3002676/open-company/magical-
tech-behind-paper-ipads-color-mixing-perfection - article on
Paper’s color mixer
References cont’d
• http://www.ftir.ru/docs/%D0%A1%D0%BF%D1%80%D0%B0%
D0%B2%D0%BE%D1%87%D0%BD%D1%8B%D0%B5%20%
D0%BC%D0%B0%D1%82%D0%B5%D1%80%D0%B8%D0%
B0%D0%BB%D1%8B/drift%20theory.pdf – a PDF that comes
pretty close to explaining what it is (and its most often used
form in programs)
• http://www.rpdms.com/wineyrpt.html
• https://quickgit.kde.org/?p=krita.git&a=tree&h=7a7bac0a9ff5767
e59ef856fb3fa9b96865b8eb8&hb=202e453cbae6417748bca3d
93588e0ad4ae1e7c5&f=krita%2Fplugins%2Fextensions%2Fpai
nterlyframework – Krita’s Kubelka-Munk based color mixer, from
a commit back when it was still part of the project
Aka me trying to google the Kubelka-Munk theory

Mixing paints (!!Con 2016)