Sequence Algebraic Modelling Of Pixel Colours


by

Huen Y.K.

CAHRC, P.O.Box 1003, Singapore 911101
email: huens@mbox3.singnet.com.sg

(A short communication - 1st released: 3/9/97.)


Abstract

Oil painters and pixel painters handle colours differently. This is because oil colours are subtractive whereas pixel colours are additive. The two media diverge even further with the easy availability of colour scanners and digital LCD cameras with the result that pixel artists need hardly to do colour blending based on colour theory. In spite of the divergence, fundamental requirements in colour harmony are based on the same colour theory practised for centuries by oil painters. The continued improvements of painting and rendering softwares give greater range of techniques to pixel artists. On the other hand, oil painting still remains quite a messy and slow process. Pixel artists can paint in both space and time whereas the latter dimension is denied to easel artists. Pixel artists can also choose to display their work in virtual art galleries in the Internet which has worldwide accessibility. The author predicts that pixel art will develop along an independent path quite different from easel art in future [3].


1. Introduction

When I first took up oil painting by myself, I have to do a lot of reading to find out the meanings of hues, tints, intensity, values, colour identification and mixture, and most important of all colour harmony. It took me some weeks to distinguish between intensity and values because such descriptions in books on art are too descriptive for one whose life have been spent on deterministic sciences including mathematics. So, I thought that it might be useful to others like me who would like to see some of these items explained mathematically. This opportunity was opened to me after I developed sequence algebra in 1994 [1].

The original publication by Grumbacher was intended as an illustrated guide for oil painters in colour mixing and selection, colour theory, colour identification and colour harmony [2]. The material presented is rudimentary but sufficient for oil painters to get a quick grasp of colour fundamentals. The information contained therein is not all useful to pixel artists since pixel colours are additive whereas oil colours are subtractive. For example, if one mixes the primary colours of red, yellow, and blue, the end result is a dark mess. Doing the same using VB function of RGB(255,255,255) will result in a white colour. Another difference is that oil paints are based on the three primary colours of red, yellow and blue whereas pixel painting is based on the primary colours of red, green and blue. The additive properties of pixel colours facilitate handling by mathematics. All the sequence algebraic formulae are developed for pixel colours only since such formulae cannot handle both oil colours and pixel colours simultaneously.


2. Grumbacher's Visualisation Chart [2]


This section describes how sequence algebra can be used to model Grumbacher's Visualisation Chart which is a chart showing the basic colours of the light spectrum and the gradations of tints obtained when these are blended with varying amounts of white and the gradations of lower intensities when these are blended with varying amounts of black. Whilst such a visual chart is handy, physiologically few of us are able to distinguish fine resolutions of hues, tints, intensities and values by visual means. This can be made easier if colours are quantified just like what is being done in VB's RGB function where the three primary colours are given 256 levels each ranging from 0 to 255. RGB(0,0,0) generates black and RGB(255,255,255) generates white. By varying these three levels, one could get 2^24 different colour mixtures. An important consideration is that although colours are additive, it is mathematically wrong to assume that these can be represented uniquely on a natural number scale. For example the sums of RGB(255,125,125], RGB[125,255,125], and RGB[125,125,255] are all the same, yet the resultant colours are all different.

Purely from the point of view of an artist, one does not need so many colours. Even if one could, other viewers have physiological limitations and will not be awared of such fine resolutions. So the modelling will be based on something more realistic as orginally described in Grumbacher's Visualiastion Chart.

We defined Purecolor(z) as the colour sequence of the rainbow. There are only twelve identified colours (or hues) and these are quanitfied in Table 1:


...................Table 1 -- Quanitification Of Hues
--------------------------------------------------------------------------------------------------
Hues.................................Index Values to z-variable
--------------------------------------------------------------------------------------------------
Violet.................................1
Blue Violet.........................2
Blue...................................3
Blue Green.........................4
Green.................................5
Yellow Green.....................6
Yellow...............................7
Yellow Orange...................8
Orange..............................9
Red Orange.......................10
Red...................................11
Red Violet ........................12
---------------------------------------------------------------------------------------------------


Equation(1) shows how the 12 hues will be represented:

Purecolor(z):=sum(1/z^i,i=1..12);

...................................1.......1........1.........1........1........1.........1........1........1.......1.......1
Purecolor(z) := 1/z + ---- + ---- + ---- + ---- + ---- + ---- + ---- + ---- + --- + --- + --- ....(1).
.....................................2.......3........4.........5........6........7..........8.......9.......10.....11.....12
...................................z.......z.........z.........z.........z.........z.........z........z.........z........z.......z

To generate tints, one adds varying amount of white to the hues in equation (1). These quantifications of white are represented by equation (2).

White(z):=sum(1/w^j,j=0..4);

.................................................................1........1........1
.............................White(z) := 1 + 1/w + ---- + ---- + ---- .............................(2).
...................................................................2.........3........4
.................................................................w.......w.......w

To generate lower-intensities, one adds varying amounts of black to the hues in equation (1). These quantifications of black are represented by equation (3).

Black(z):=sum(1/b^k,k=0..4);

.................................................................1........1........1
..............................Black(z) := 1 + 1/b + ---- + ---- + ---- ..............................(3).
...................................................................2........3........4
.................................................................b........b........b

The tint sequence Tint(z) is obtained by the sequence product of Purecolor(z) and White(z) as given in equation (4). From any of the term in equation (1), the z-vairable identifies the hue and the w-variable the increasing amount of white. There are 12*4 = 48 tints generated. Of course the hue itself can be represented as z^i*w^0 = z^i but this simply reverts back to Purecolor(z) itself. Thus a tint is identified by two numbers and can be expressed as Tint(hue, white).



.........................1.......1.........1........1.......1........1.........1.........1.........1........1..........1.........1
Tint(z) := 1/z + --- + ---- + ---- + ---- + ---- + ---- + ----- + ---- + ---- + ---- + ----- + -----
.......................z w........2..........2......2........3.........3......2...2......3..........4 .......4.....2..3......3...2
..................................z.......z.w......z..w....z.......z w.....z..w.......z..w ....z.......z....w..z....w....z..w

......1.......1.........1..........1..........1.........1........1...........1.......1..........1.........1........1
+ ---- + ---- + ----- + ----- + ----- + ---- + ---- + ----- + ----- + ----- + ---- + ----
........4.......5......2..4......3...3.....4...2......5.........6.......3..4.....4..3.......5..2.......6........7
..z..w......z.......z..w......z...w.....z..w......z..w.....z.......z..w.....z..w......z..w......z..w.....z

......1.........1...........1.........1........1.........1..........1.........1.........1.........1.........1........1
+ ----- + ----- + ----- + ---- + ---- + ----- + ----- + ----- + ---- + ---- + ----- + -----
.....4..4.....5..3.......6..2........7.........8.......5..4.....6..3.....7..2......8..........9......6..4.....7..3
....z..w....z..w.......z..w......z..w......z.......z..w....z..w.....z..w.....z..w.......z.......z..w.....z..w

.......1........1........1........1..........1.........1..........1.........1........1..........1.........1..........1
+ ----- + ---- + --- + ----- + ----- + ----- + ----- + --- + ----- + ----- + ------ + -----
......8..2.....9........10......7..4.....8..3......9..2......10........11.....8..4......9..3....10..2......11
....z..w.....z..w.....z......z..w......z..w.....z..w......z...w......z......z..w.....z..w......z...w......z...w

....1........1...........1............1..........1...........1...........1..........1...........1...........1............1
+ --- + ----- + ------ + ------ + ----- + ------ + ------ + ------ + ------ + ------ + ------.....(4).
.....12......9..4.....10..3......11..2.....12......10...4.....11..3....12..2....11..4.......12..3......12..4
....z.......z..w......z...w......z ..w.....z....w....z....w......z...w.....z...w.....z...w.......z...w......z...w

Likewise the lower-intensity sequence called Lowerintense(z) is obtained by the sequence product of Purecolor(z) and Black(z) as given in equation (5). When hues are mixed with varying amounts of black, one gets the lower-intensities spectrum. Again we can identify the 48 resolutons by Lowerintense(Hue, Black).

Lowerintense(z):=sort(expand(Purecolor(z)*Black(z)));

.......................................1.......1........1.........1........1........1.........1..........1........1........1........1
Lowerintense(z) := 1/z + --- + ---- + ---- + ---- + ---- + ---- + ----- + ---- + ---- + ---- + -----
......................................b z........2.........2.......2.........3.........3......2..2.......3.........4.........4.....2..3
................................................z.......b.z.......b..z......z.......b.z......b..z.......b..z.....z........b.z.....b..z

......1.........1........1.........1........1..........1..........1........1........1........1...........1...........1
+ ----- + ---- + ---- + ---- + ----- + ----- + ----- + ---- + ---- + ----- + ----- + -----
.....3..2......4..........5.........5.....2..4......3..3......4..2........6.........6.....2..5.....3..4......4..3
....b..z......b..z......z.......b.z.....b..z.......b..z......b..z........z.......b.z......b..z......b..z.......b..z

............1........1.........1..........1.........1.........1.........1........1..........1...........1.........1.........1
.......+ ---- + ---- + ----- + ----- + ----- + ---- + ---- + ----- + ----- + ----- + ---- + ----
..............7.........7......2..6.....3..5......4..4........8.........8......2..7.....3..6......4..5........9..........9
............z........b.z......b..z.....b..z......b..z........z.......b.z......b..z.......b..z......b..z........z........b.z

.............1.........1..........1.........1........1.........1..........1..........1........1.........1.........1...........1
.......+ ----- + ----- + ----- + --- + ----- + ----- + ----- + ----- + --- + ----- + ------ + -----
............2..8......3..7.....4..6......10........10.....2..9......3..8......4..7.....11.......11.....2..10.....3..9
...........b..z......b..z.....b..z.......z........b.z......b..z.......b..z......b..z.......z........b.z......b..z.......b..z

.............1........1........1...........1............1..........1..........1...........1...........1...........1...........1
.......+ ----- + --- + ----- + ------ + ------ + ----- + ------ + ------ + ------ + ------ + ------
............4..8......12.......12.....2..11......3..10......4..9.....2..12.....3..11.....4..10.....3..12.....4..11
..........b..z........z......b.z.......b..z........b..z........b..z......b..z.......b..z........b..z........b..z.......b..z

.............1
......+ ------ ..............................(6).
............4..12
..........b...z

One would have thought that if whites are added to the lower intensities range, one would get back exactly the tints but it is impossible. This is because no amount of white can swamp the black already present in this range. Therefore, if whites are added to a row in Lowerintense(z), you can 4*48 tints which are different from Tint(z). Similar remarks applied to the Tint(z) if black is added to a row. In other words, you cannot get exact tint or lowerintensities match by blending the existing ranges with more black or white. Equations (7) and (8) show how these can be obtained without further elaborations.

Lowerintense_Tint(z):=sort(expand(Lowerintense(z)*Black(z))) ............................(7).

Tint_Lowerintense(z):=sort(expand(Lowerintense(z)*White(z))) .............................(8).

In this section, one manages to formulate sequence expressions to represent hues, tints, and lowerintensities. In the next section we will discuss the meaning of values.


3. Values


Value is an important dimension of colour for the artist because, through a knowledge of value, he can simulate form and effect emphasis through contrasts in light and shade. Areas in the direct path of light are higher (lighter) in value than areas which are patially lighted or in shadow. Value is the only dimension of colour which can exist outside of colour and is so represented here for simplicity by the scale of nine equidistant neutral grays as shown in equation (9).

Grayscale(z):=sum(1/g^i,i=0..9);

.....................................................1........1.......1........1.........1........1.........1........1
...........Grayscale(z) := 1 + 1/g + ---- + ---- + ---- + ---- + ---- + ---- + ---- + ---- ...........(9).
........................................................2.......3........4........5.........6........7.........8.........9
......................................................g........g.......g........g..........g........g.........g.........g

You can adjust other monochromatic scale to conform with the Grayscale by a sequence product. For example, suppose one wishes to adjust Yellow-Orange to the Grayscale by assigning it to the 6th value. Then the remaining gradations can be obtained by a sequence product as shown in equation (10). Orange-Yellow has a hue of 8.

Colorvalue(z):=sort(expand(1/z^8* Grayscale(z));

............................1........1........1..........1..........1..........1..........1..........1.........1..........1
Colorvalue(z) := ---- + ---- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ----- .....(10).
..............................8.......8......2...8......3..8......4..8......5..8......6..8.....7..8......8..8.....9..8
............................z......g.z......g...z......g..z.......g..z.......g..z.......g..z......g..z.......g..z.....g..z

The interpretation in equation (10) is that the first term of 1/z^8 has the lowest value, i.e., the darkest, and the last term 1/(g^9*z^8) where the sum of indices is the highest has the highest value, i.e., the lightest. This generates a monochromatic colour value scale following the gray scale and is to be interpreted as such. Thus in sequence algebra, colour values should be interpreted by two numbers, i.e. Colorvalue(hue, grayscalenumber). One must remember that only monochramtic colour value scale can be mapped uniquely this way. This problem has been mentioned in the previous section, as it is impossible to map values of all monochromatic colours into a 1-dimensional natural number scale.


4. Colour Balance and Harmony


Too much conformity with colour theory will not produce vibrant paintings. The choice of a palette of colour could dictate mood, the simplest of which is the choice between warm colours such as orange and red and cool colours such as green and blue. Not much information is currently available on the effects of animation on colours although one suspects that fine gradations of colours in rapid animated scenes are ineffective. In short, animation artists could do with less colours gradations than easel artists by compensating dynamically blended colours.

Monochromatic harmony represents a harmony arrived at through variations in the value and intensity dimensions of a single colour. One could also achieve colour harmony through the use of complementing colours and the other is by means of closely associated hues. The rules and practice developed by oil painters are not all relevant to pixel artists because of the time dimension available to the latters. When two colours are toggled rapidly, visual retentivity could give rise to the illusions of colour mixtures with some unusual visual effects. You get less of these from static easel paintings. The subject of colour balance and colour harmony is vast. Handling of colours is a very personal thing which could only be gained by experimentations but conventional colour theory is still a good starting point.

Having said all that, it must be pointed out that pixel artists could afford to correct mistakes more rapidly than oil painters. This means that pixel artists could conduct a lot of experiments in a short time to build up his personal experience.


5. Concluding Remarks


This paper shows how sequence algebra could be used to model various attributes in colour theory such as hues, tints, lower-intensities, values and so on. To the mathematically minded, this might be a better way to explain the distinctions amongst these terms. This is because there are overlaps in meanings especially between intensities and values. Values should be viewed as monochromatic intensity gradations although some oil paint manufacturers attempt to assign values to all colour across the board. This seems a dubious move since one cannot say whether a yellow hue has higher value than a blue hue since from colour complementarity point of view in pixel colours, these three primary colours should have the same value.

Pixel artists have access to both space and time in painting. Pixel art can be given worldwide accessibility without relying on existing galleries and museums. Viewers can visit virtual art galleries at any hour he chooses and even download the originals if he likes a particular art piece. Can you do this to an oil painting in a museum? Popularisation of art can be done cheaply via pixel art. This is not done for any political reason other than that art is for everyone to enjoy. Who will enjoy van Gogh's sunflowers if it is locked in the vault? Creativity and commercial potentials are very strange bedfellows. This is so when art is manipulated by people with motives only remotely connected with the appreciation of fine art.


6. References


1. Huen Y.K.: A Matrix Map for Prime and Non-prime Numbers, INT. J. Math. Educ. Sci. Technol., 1994, VOL. 25, NO.6, pp 913-920.

2. Color Compass by M. Grumbacher Inc. Cat. No.B425, New York, N.Y. 10001, (1977).

3. The Techniques of the Great Masters of Art: Chartwell Book Inc. (Reprinted 1993).

======================== END OF PAPER ======================