Painting colour analysis

Marc R. Plamondon

The following tool allows one to view the colour composition of images of paintings. The tool is meant to be an introduction to how digital computation can aid the analysis of visual art.

The images of paintings can be viewed according to their grey-scale composition and their colour composition. In both cases, the image is divided into four hundred equal (rectangular) parts.

The grey-scale rendering of the image is calculated according to the following formula for each pixel: 21.26% of the red value + 71.52% of the green value + 7.22% of the blue value. The average value for all the pixels in a section is computed. These are represented in the 20 x 20 table. They are also represented in the five equal horizontal divisions of the image and the five equal vertical divisions of the image. These last two are provided in the interest of determining whether or not there is a lightness-darkness progression in the painting.

The colour rendering of the image reduces the painting to 125 colours. If all the colours that a computer can represent are reduced to the three-dimensional components of red, green, and blue (where every component has a value between 0 and 255), then all the colours can fit into a three dimensional cube. The 125 colours used for this analysis are the colours at the center of each cube if the one colour cube were divided into 125 smaller cubes (5 x 5 x 5). Each of these colours is shown with a number triplet (where the numbers refer to the smaller cubes based on the index of red, green, and blue coordinates).

For the painting reduced to 125 colours: each pixel of the image is transformed into the main (central) colour of each 125 colour cubes. The colour represented on the grid of 400 sections of the image is the colour (of the 125 colours) that is most dominant among the pixels in that section of the image. When the dominance is not strong (less than two thirds), then a second colour is displayed to the right of the dominant colour: this is the sub-dominant colour (which only gets displayed when its dominance is at least 10%).

For the distribution of the colours of the original image, sorted into the 125 colours, each pixel is transformed into its closest colour (of the 125 colours). The percentage that each of these 125 colours is represented in the original image is calculated and displayed in the table.

For the distance between adjacent colours in the reduced image, the distance between the 125 colour cubes is used to determine the degree of contrast within the reduced image. If two colour cubes are adjacent, then the distance between them is 1. The greatest distance between two reduced colours is 6.93 (which is the distance between colour 1-1-1 and 5-5-5). The distance between the colour of each of the 400 sections of the image and the colour of each of the sections that border the original section (including diagonally: a central section has eight bordering sections) is calculated, for the dominant colours only. The greater the distance between colours, the greater the degree of colour contrast.

Proceed to paintings.