
The transformation into the pq plane is achieved with the following
matrix:
To decide into which class a colour belongs, the following equations
are analysed:
skin colour, where p = -0.102,`q = -0.099, l = 1, a = 0.601, sp = 0.00769 and sq = 0.0035:
![]()
neutral colour:
p2 + q2 = 0.152
Whether a colour is red, green or blue is determined by the largest of the three coordinates (RGB). As the classes overlap, the following scale of priorities is used: skin > grey > red, green, blue.
Once the colours are classified, a separate transformation matrix
is calculated for each class in the following way. A 17x17x17 RcGcBc colour
cube is output on the printer and the XYZ coordinates of each patch are
measured. These are then converted to L*a*b* and a lightness compression
is carried out, so as to accommodate for the different lightness ranges
of the two media.
L*í = k(L* - L*p(min)) + L*c(min)k = (L*c(max) - L*c(min))/(L*p(max) - L*p(min))
Here the index c refers to the CRT and p to the printer. The CIELAB
coordinates are then converted back to XYZ and finally to RpGpBp, then
the (3x11) transformation matrix (Mi) used for a particular class is obtained
using linear regression. Finally, the transformation for a particular class
is the following:
f(x,y) = Mi fí(x,y)f(x,y) = [Rp, Gp, Bp]T
fí(x,y) = [Rc, Gc, Bc, Rc^2, Gc^2, Bc^2, RcGc, RcBc, GcBc, RcGcBc, 1]T
To avoid unnatural colour edges between areas of pixels of different
colour classes, the transformation matrices for colours on the edge of
a region having a particular colour class are convoluted with the matrices
of the neighbouring pixelsí transformation matrices in the following way:
f(x,y) = sum{wi(x,y)Mi fí(x,y)}
Here i is the label of a colour class (1 = skin, 2 = grey, Ö), n2
is the number of pixels in the neighbouring area taken into account and
ki is the number of pixels in the neighbouring area belonging to class
i.
Even though some details of the implementation could be improved, the
idea of classifying colours is probably worth considering, as the need
for different kinds of transformation for different colours is commonly
suggested and was also implemented by other authors (e.g. Spaulding et
al. (1995)). Also the technique for colour classification proposed here
is a simple and generic one, which makes it easy to incorporate it into
other gamut mapping algorithms.