Mixing paints (!!Con 2016)

47
Mixing Paint! With Computers!

Transcript of Mixing paints (!!Con 2016)

Page 1: Mixing paints (!!Con 2016)

Mixing Paint!With Computers!

Page 2: Mixing paints (!!Con 2016)

Let’s talk about colors

Page 3: Mixing paints (!!Con 2016)

Let’s talk about colors

Page 4: Mixing paints (!!Con 2016)

Let’s talk about colors

Page 5: Mixing paints (!!Con 2016)

Colors in Code

Colors as combination of Red, green, blue lights

Page 6: Mixing paints (!!Con 2016)

RGB Model

Page 7: Mixing paints (!!Con 2016)

Mixing Colors

Page 8: Mixing paints (!!Con 2016)

Mixing Colors

Page 9: Mixing paints (!!Con 2016)

Mixing Colors

Page 10: Mixing paints (!!Con 2016)

Mixing Colors

Page 11: Mixing paints (!!Con 2016)

Mixing Colors

Page 12: Mixing paints (!!Con 2016)

Mixing Colors

Page 13: Mixing paints (!!Con 2016)

Mixing Colors

R: 1.0G: 0B: 0

R: 1.0G: 1.0B: 0

R: 1.0G: 0.5B: 0

Page 14: Mixing paints (!!Con 2016)

Mixing Colors?

R: 0G: 0

B: 1.0

R: 0.5G: 0.5B: 0.5

R: 1.0G: 1.0B: 0

Page 15: Mixing paints (!!Con 2016)

So how does mixing paint work?

• Let’s talk about physics

Page 16: Mixing paints (!!Con 2016)

Visible Light Spectrum

380 nm 750 nm

Page 17: Mixing paints (!!Con 2016)
Page 18: Mixing paints (!!Con 2016)
Page 19: Mixing paints (!!Con 2016)
Page 20: Mixing paints (!!Con 2016)
Page 21: Mixing paints (!!Con 2016)

Subtractive color

Page 22: Mixing paints (!!Con 2016)

CMYK color model

Page 23: Mixing paints (!!Con 2016)
Page 24: Mixing paints (!!Con 2016)

Mixing Colors Again

C: 1.0M: 1.0

Y: 0

C: 0M: 0

Y: 1.0

C: 1.0M: 1.0Y: 1.0

Page 25: Mixing paints (!!Con 2016)

Now what?

• Other color spaces?• Need to convert to RGB to display on screen

Page 26: Mixing paints (!!Con 2016)

Let’s try physics

Page 27: Mixing paints (!!Con 2016)

Kubelka-Munk theory

• Returns reflectance of light for a layer of pigment on a surface

Page 28: Mixing paints (!!Con 2016)

Kubelka-Munk theory

Page 29: Mixing paints (!!Con 2016)

White light

Kubelka-Munk theory

Page 30: Mixing paints (!!Con 2016)

White light

Scattering,Absorption,Etc.

Kubelka-Munk theory

Page 31: Mixing paints (!!Con 2016)

White light

Scattering,Absorption,Etc. Colored light

Kubelka-Munk theory

Page 32: Mixing paints (!!Con 2016)

Case Study: Krita Color Blending

Page 33: Mixing paints (!!Con 2016)

Case Study: Krita Color Blending

Removed in 2012 :<

Page 34: Mixing paints (!!Con 2016)

Kubelka-Munk theory

• It’s complicated to implement.• Needs information not provided by RGB• Physically accurate (to a point)• Can we do better?

Page 35: Mixing paints (!!Con 2016)
Page 36: Mixing paints (!!Con 2016)
Page 37: Mixing paints (!!Con 2016)
Page 38: Mixing paints (!!Con 2016)

Case Study: Paper (iPad App)

Page 39: Mixing paints (!!Con 2016)
Page 40: Mixing paints (!!Con 2016)

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

Page 41: Mixing paints (!!Con 2016)

Thank you!

Diana Liao@dmliao

Page 42: Mixing paints (!!Con 2016)

Extras

• Stuff that didn’t make it into the 10 minutes, and other links

Page 43: Mixing paints (!!Con 2016)

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

Page 44: Mixing paints (!!Con 2016)

Color is not intuitive

Page 45: Mixing paints (!!Con 2016)

Kubelka-Munk theory

(1–R)²/2R = k/s = Ac/s

Where:R = reflectancek = absorption coefficients = scattering coefficientc = concentration of the absorbing speciesA = absorbance

Solve for R and convert reflectance to RGB

Page 46: Mixing paints (!!Con 2016)

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

Page 47: Mixing paints (!!Con 2016)

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=7a7bac0a9ff5767e59ef856fb3fa9b96865b8eb8&hb=202e453cbae6417748bca3d93588e0ad4ae1e7c5&f=krita%2Fplugins%2Fextensions%2Fpainterlyframework – 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