1

Local paint shop can mix any RAL or NCS color I choose but considering the required minimum volume I would be wasting money by throwing unused paint to trash. I have an idea of buying standard pre-mixed opaque acrylic paint colors - blue, red and yellow (RYB primary colors), white (to lighten) and black (to darken) - and I should be good to go.

I can also buy pre-mixed green, orange and violet (RYB secondary colors) to skip mixing primary colors. (There are also other pre-mixed colors like gray and brown but lets ignore them.)

I have a colorimeter and I can measure RGB values of these paint colors.

So, I have defined set of 8 paint colors with known RGB values.

My question is obvious. Is there algorithm that takes desired target RGB color as input and outputs proportional amnounts of source colors? (I believe there is, how would a printer know how to mix CMYK on white paper. OK, dealing with actual paint color is much more complicated than dealing with light mixing because of pigments and different absorbtion and reflection characteristics of paint colors, but anyway...)

Product of mixing suggested proportional amnounts does not have to be (and can´t be) a perfect match with target color, but as close as possible.

Algorithm should optimally use source colors, i.e., it will not mix blue and yellow to get green, but use available green instead.

If I remove green color from defined set, algorithm should use blue and yellow to get green, of course.

If I add already mentioned gray and brown or more colors to defined set, algorithm should use them when neccessary.

Algorithm should not overcomplicate mixing trying to use every available source color even when not neccessary. There should be option to limit number of source colors that can be used. I mean, with 8 source colors I tell algorithm to use only 3 colors and algorithm will choose the best combination to get closest to target color.

Knowing the difference (e.g., in %) between desired target color and expected mixed color would be a nice indicator to have.

Is this possible? If not, I still can manually mix as many colors I need, write down proportions, measure RGB values and create a fix color chart to have consistent results in future. Such algorithm would be great tool to get idea how to start mixing at all.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
  • Do they sell sample pots? Very small but might be enough for some purposes. – rossum Mar 11 '21 at 19:46
  • FYI, there's [another question here](https://stackoverflow.com/questions/1351442/is-there-an-algorithm-for-color-mixing-that-works-like-mixing-real-colors?rq=1) which seems to cover some of the same ground. – 500 - Internal Server Error Mar 11 '21 at 23:11
  • 1
    maybe this [Algorithm to find which two colors mix to form a third color (in JavaScript)](https://stackoverflow.com/a/56457120/2521214) might help ... however I think you would need to scale the amounts on per paint type basis. Something similar to White balance for RGB so in your case Black or Grayscale Balance. So first I would create few grades of shade and use the used ratios as weight coefficients that will scale the results... – Spektre Mar 12 '21 at 06:45
  • rossum, no sample pots, 1 liter or 0,2 gallon is the minimum amount. – Boris Gereg Mar 12 '21 at 06:55
  • 500 - Internal Server Error - I have read that before I posted my question. I am unable to apply it to my scenario. Will read it again and again. Spektre - I have read that as well. Yesterday I bought red, yellow, blue, white and black and will get my hands dirty soon. Any other ideas? – Boris Gereg Mar 12 '21 at 07:00
  • @BorisGereg I think with CMY you will have less trouble converting as that is the basis for substractive color mixing (reflection) similarly like RGB is basis for additive mixing (light emission). Start with the gray scale ... so mix as many shade grades as you can remembering the ratios. .. plotting a 2D plot for each color C,M,Y versus shade intensity. Then you will see if the dependence is linear and in which ratios exactly from there you can compute any color to volumes or masses of paints ...unless some other stuff like chemical interaction or what ever messes thing up – Spektre Mar 12 '21 at 11:00
  • @Spektre I got acrylic paints close to cyan and yellow and mixed them in 1:1 ratio and got green. Colorimeter readings: C: RGB(0, 150, 205) or #0096CD, Y: RGB (242, 220, 0) or #F2DC00 and G: RGB(65, 163, 76) or #3FA34C. Photoshop color picker: C: HSB(196, 100, 80), CMYK(100, 14, 11, 0), Y: HSB(55, 100, 95), CMYK(2, 12, 100, 0) and G: HSB( 128, 61, 61), CMYK (96, 4, 100, 1). In HSB, G hue is obvious, in the middle, but what about S a B? In CMYK, M is strange... What is math behind this, in HSB and CMYK. I will do gray scales tomorrow and plot the results. I will get magenta on Monday. – Boris Gereg Mar 14 '21 at 01:19
  • @BorisGereg You can not do math in HSB/HSV ..its just poor approximation of human color perception and totally abstract. Its based on [color of wavelength basis but they screw it and even my simple one is way better](https://stackoverflow.com/a/22681410/2521214) I created answer with the pointers how to do this as It was starting to be unreadable in comments. – Spektre Mar 14 '21 at 08:30

1 Answers1

0
  1. you need to have normalized RGB values as input

    that means for any grayscale color R==G==B if not true then you have not normalized RGB space and need to sclae it usually like this:

    R = 0.30*R'
    G = 0.59*G'
    B = 0.11*B'
    

    also hope your colorimeter has its own light source otherwise you need to use specific lighting conditions.

  2. normalized CMYK math

    again for grayscale colors C==M==Y The math conversion from RGB to CMY (assuming 8 bit values) is:

    C = (255 - R)
    M = (255 - G)
    Y = (255 - B)
    

    If you have also Black color then you can apply this:

    K=min(C,M,Y)
    C-=K
    M-=K
    Y-=K
    
  3. not normalized CMY

    You just apply scaling similarly like in RGB. The value will depend on your paints. However I am not sure it will be just constant as the paints might interact chemically (just wild guess). If we pretend it is then first do a measurement. Create as good grayscale shade as you can and remember the C,M,Y paint ratios (so volume or weight). Divide the ratios by biggest one (this will normalize the range to <0,1>) and the result are your coefficients that convert non normalized CMY to normalized CMY just by multiplying.

Spektre
  • 49,595
  • 11
  • 110
  • 380
  • Sorry, I dont follow. Are you saying I should take my C, M, Y and W (white) paint colors, prepare e.g. 11 pots and in each pot put a mix in C:M:Y:W ratios of 1:1:1:0, 9:9:9:3, 8:8:8:6, ..., 2:2:2:24, 1:1:1:27 and 0:0:0:1, afterwards measure all pots using a colorimeter (yes, with own light source and selfcalibration), convert measured RGB values to CMY and plot three data series - x axis showing 0 %, 10 %, 20 %, ..., 90 % and 100 % and y axis showing C, M and Y values? – Boris Gereg Mar 14 '21 at 14:02
  • @BorisGereg That could work too... I was thinking tweaking the ratios until you got as good gray shade as you can measure its intensity with colorimeter and add this as point point to the plots (x is measured intensity , and y is the amount of C,M,Y. Also I would not touch White/Black until C,M,Y coeficients are resolved. Once few points (at least 3...5) are ploted you will directly see if the plots are just lines which would mean constant ratios ... If not then you can use the plots to reverse the formula for ratios as function of intensity ... – Spektre Mar 14 '21 at 20:39
  • 1
    I can imagine I find mix e.g. C90 M92 Y85 to be good gray shade, but this is only one point, the most saturated gray. Isn´t the only way of getting lighter shades of gray to add White? CMYK model assumes white base, like white paper. CMYK(0,0,0,0) is the white. This does not apply to paint scenario where I must create the white base. Can you please explain how to get more points from you recent post? – Boris Gereg Mar 14 '21 at 22:50
  • @BorisGereg Ow you right I forget its different with paint (and multiple of ratio is the same color just different volume) and you need to mix with white or black to obtain shades so the plots will not do at least for grayscale ... If we pretend dependence is linear then after you mix a gray the ratios gives you coefficients for normalized C,M,Y for your used paints. (I removed the wrong part from my answer) – Spektre Mar 15 '21 at 06:20