Mobile app version of vmapp.org
Login or Join
Jamie315

: How to simulate paint mixing? Everybody who ever painted knows that blue and yellow make green. Yet on a computer (at least in the RGB model), blue and yellow make white. Yes, it's mixing

@Jamie315

Posted in: #Color #ColorTheory

Everybody who ever painted knows that blue and yellow make green. Yet on a computer (at least in the RGB model), blue and yellow make white. Yes, it's mixing paint vs adding light, but how do you explain the difference, and how can one model the "paint mixing" on a computer, e.g. in gimp?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Jamie315

3 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

Most likely they blend in hsv space:

from Tkinter import *
from colorsys import rgb_to_hsv, hsv_to_rgb

def ablend(a, fg, bg):
return ((1-a)*fg[0]+a*bg[0],
(1-a)*fg[1]+a*bg[1],
(1-a)*fg[2]+a*bg[2])

# replace ablend with hsvblend
def hsvblend(a, fg, bg):
fgh = rgb_to_hsv(fg[0]/255.,fg[1]/255.,fg[2]/255.)
bgh = rgb_to_hsv(bg[0]/255.,bg[1]/255.,bg[2]/255.)
ret = hsv_to_rgb(
(1-a)*fgh[0]+a*bgh[0],
(1-a)*fgh[1]+a*bgh[1],
(1-a)*fgh[2]+a*bgh[2])
return ret[0]*255,ret[1]*255,ret[2]*255


root = Tk()
num=8.0

fg=(255, 255, 0)
bg=(0,0,255)

for i in range(int(num)+1):
col = ablend(i/num, fg, bg)
e = Label(root, width=20,height=2,text='#%02x%02x%02x' % col, background='#%02x%02x%02x' % col)
e.grid(row=i)
col = hsvblend(i/num, fg, bg)
e = Label(root, width=20,height=2,text='#%02x%02x%02x' % col, background='#%02x%02x%02x' % col)
e.grid(row=i,column=1, sticky=E+W)
root.mainloop()


results in:



Image 1: Colors as of result of blend (left), blend in hsv space (right). Note that the RGB colors are much more saturated than paint colors so green is not entirely halfway to deep blue and perfect yellow.

PS: How it is computed is not generally called color theory by the way. That is something different.

10% popularity Vote Up Vote Down


 

@Si6392903

Edited

Reading this sometime later I realized that this does not answer the question.

The answer is indeed blending modes.

And yes, blue and yellow makes black. But the problem with this is not the multiply mode, the problem is that the mix should be yellow and cyan, not blue.

In RGB mode yellow is a mixture of Red and Green, and if you add blue you get white.

In multiply mode it is let's say the opposite.

You take Yellow (pigment primary) and Blue (in pigment blue has cyan and some magenta) so basically if you keep mixing them, as you are using all 3 primary colors you get black.

Here is a topic where I try to address some pre-computer blending modes: photo.stackexchange.com/questions/83002/what-is-the-pre-computer-version-of-photoshops-blending-modes/83006#83006


The pigment samples

There are some applications that simulate paint styles.

One free and good one is MyPaint mypaint.intilinux.com/ otake.com.mx/Foros/Test-MyPaint-01.png
One that has a great look, also free shipped in Windows 8 is FreshPaint apps.microsoft.com/windows/es-mx/app/fresh-paint/1926e0a0-5e41-48e1-ba68-be35f2266a03
The commercial leader is Corel Painter www.painterartist.com/us/product/paint-program/ otake.com.mx/Foros/Test-Painter-01.png
The "wet" component

These programs have a component that will help you a lot. They all have a fresh paint mode to some degree. This is that mix colors like a wet medium (oil, acrylic, watercolor). Not only they mix the color by subtraction, but they drag it.

A no specialized software will put the next color above the previous one.

Using normal software

If you choose to use gimp you need to change the Paintbrush mode.

In the tool box choose Mode > Multiply. This will not look like an oily medium but as a marker. The blue marker will make a previous yellow color green, but also will make each pass darker, like when you use a water based marker.
otake.com.mx/Foros/Test-Gimp-01.png
Use RGB color mode

Don't use a CMYK model to "paint". The use of black for print use very specific matrices to assign the ink.

You will be making crazy mixings and these effects work better in RGB. You can transform the RGB to a CMYK output later.

The light samples

I probably would use a 3d render to simulate projections. As always my first free choice is Blender www.blender.org/

10% popularity Vote Up Vote Down


 

@Eichhorn212

If you switch over to the CMYK gamut, I suspect you will get mixes much more like what you would expect from physical pigments. There are drawbacks though. One is that CMYK is a smaller gamut than RGB. For example, 100% K is only around 93% RGB black, so switching from RGB to CMYK, you may notice the colors flatten a bit. Another thing to watch out for is transparency effects like Screen, Color Burn, and even drop shadow effects in the various CC products can produce unexpected results. Yet one more is the fact that there are many effects and filters that are unavailable in CMYK color mode. I'm not familiar with GIMP, so your results may vary.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme