From: lilleyc@cs.man.ac.uk (Chris Lilley)
Newsgroups: comp.graphics
Subject: Re: Need formula: f(paint pigments)=RGB
Date: 17 Nov 92 04:21:24 GMT
Organization: Dept Computer Science, University of Manchester, U.K.

In article <1992Nov14.203435.12713@aimla.com> ken@optimla.aimla.com
(Ken Ellinwood) writes:

>I need a formula or algorithm to translate proportions of red, yellow
>and blue paint pigments that have been mixed with a white base into an
>appropriate RGB value for display on an NTSC monitor.  The formula is
>to be used in software that allows a user to simulate real-world paint
>mixing.

OK. The converting to display on a particular monitor bit is easy. You
have a specification of the colour of your paint mixture (in CIE XYZ,
say) and you plug this into a formula that uses the characteristics of
your monitor to generate RGB values to display. As I said this bit is
simple - if you have problems mail me and I will send you a file that
explains this bit.

Much more difficult is the first bit - predicting the colour of your
four way pigment mix. This depends on a number of factors - the
precise colour of your initial pigments, their opacity, the order they
were laid down (if using washes), the illumination conditions, the
depth of staining of each colour...

We need to make a few simplifying assumptions. Firstly, the light
source is a diffuse daylight, or not too far from it. Second, the
paints are chemically inert, dont react with each other and produce a
stable colour instantly. Third, the paints are thoroughly and
completely mixed in a container of some kind, not laid in washes on
the paper - so the order of adding paint is not important.
Fourthly and most importantly, we need a particular definition of the
colours of the pigments under consideration. Not just 'red'. Which
red? Mars red? Alizarian crimson1?

I will assume you have for particular paints in mind. If not - well,
imaging going to a painting & decorating shop and saying 'I have green
walls at home. Give me a green paint' and expecting a match...

First you need to model the staining behaviour as each paint is mixed
with white. For example, some colours are 'weak'-  add 5 parts of white
and they are so pale they are nearly white. Others may take 30 or 50
parts of white to dilute out most of the colour (such as the alizarian
crimson I mentioned earlier). 

Next, sample different proportions of mixtures of two colours. Then of
three colours.. The aim is to build a 4D lookup table; any desired mix
can then be interpolated from the nearest entries in the table.

Colours of mixtures could either be expressed as RGB for your
particular monitor, mixing up a colour that matches, or measured as
CIE XYZ values if you have access to a spectrophotometer.

>I expected that I might be able to look up the formula for the
>translation in a computer graphics book, but so far all of the
>literature that I have found on the subject uses the
>yellow/magenta/cyan primaries when dealing with subtractive color
>systems.  Any help would be greatly appreciated.  Thanks,

Paint mixing is a subtractive process, but does not follow the very
simplified theoretical CMY model found in introductory graphics books,
which assumes for example that the colours are fairly translucent, and laid
on white paper in a screened dot pattern rather than being mixed.



--
Chris Lilley
---------------------------------------------------------------------------
Technical Author, ITTI Computer Graphics and Visualisation Training Project
Computer Graphics Unit, Manchester Computing Centre, Manchester, UK
Internet:   lilley@cgu.mcc.ac.uk        Janet:   lilley@uk.ac.mcc.cgu
Voice:      +44 (0)61 275 6095          Fax:     +44 (0)61 275 6040
---------------------------------------------------------------------------