# Statisfaction

## Random Colours (part 2)

Posted in Art, Dataset by Pierre Jacob on 22 September 2010

In this previous post, Julyan presented the paintings of Gerhard Richter, and asked whether the colours were really “randomly chosen”, as claimed by the painter. To answer the question from a statistical point of view (ie whether the colours are uniformly distributed in the (r,g,b) space or in the (x, y, r, g, b) space for instance, where x, y is the position and r, g, b the 3 colour components), we need to extract the data. Let’s take for example the following 1024 colours painting.

The data corresponding to this painting would be a 32*32 table, and in each cell of the table there would be a colour, represented for instance by 3 numbers, like in the RGB colour model. Tonight I’ve made a python script that extracts this data, with Julien‘s help. I took the marginal mean colour along both axis and converted it into grey scale. This gives two lines with white segments and grey segments. From that it is easy to find the middle of the segments, which gives the squares’ centres. Once the square centres were found, I simply took the mean colour of a smaller square around each centre.

As an output the script creates a BMP file with one pixel per colour (so it’s a tiny image, obviously 32*32 pixels), and a R file with 3 matrices called “R”, “G” and “B”, available here. This format is usually convenient since it’s plain text but if you want another one just ask me. If we zoom on the output BMP file we get:

The script is available here if you want to try it or modify it. I fear that there might be a slight mistake in the script because the colours don’t seem to be exactly the same in the output as in the input, but hopefully it’s close enough. The script needs an image to work on, for instance you can try on the pictures from this gallery. I tested it on two other pictures:

So now we have the data for three pictures (10, 192 and 1024 colours), and we can start to do some real stats. Are we going to find the same results in the RGB model as in the HSV model for instance ? If not, which colour model should we use?

To be continued!

### 5 Responses

1. Julyan said, on 22 September 2010 at 12:28

Hey, good job men! Right, to be continued, but you two did the hard part.

2. pierrejacob said, on 23 September 2010 at 03:19

Well the geek part for sure! Anyway I think the radius I chose (5 pixels) is too big, that’s why the colours are a bit altered (probably clearer than the original colours). The problem appears only on the “1024 colours” painting. I’m too lazy to upload the fixed version. Anyway we can still do stats on these. Julyan, wanna try?

3. Random Colours (part 3) « Statisfaction said, on 24 September 2010 at 16:52

[…] — Julyan @ 16:52 Thanks to Pierre, we now have a new playground for saptial stats, see this post. Before that, let’s see if we can see basic stuff without spatial […]

4. Statisfaction said, on 6 October 2010 at 20:43

[…] are providing four projects, one of which is the following (echoing a series of posts here, here and here): Critique statistique d’une peinture […]

5. […] I supervised last year a team project at Ensae, on a statistical critique of the abstract painting 1024 Colours by painter Gerhard Richter. The four students, Clémence Bonniot, Anne Degrave, Guillaume […]