# Random Colours (part 3)

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 information.

Data consist in three 32*32 tables, R, G and B, of numbers between 0 and 255. Certainly, the tables should be considered together as a 32*32 table of (r,g,b) vectors. Still, the first basic thing to do is to plot three separate histograms for R, G and B:

compared to uniformly simulated data

We see that the painter has a bias for darker colors, and rather misses light green and light blue ones.

Then, what can we do for representing (r,g,b) vectors? I guess that a good visualization is the color triangle

A few words to explain where it comes from. Say (r,g,b) data is normalized in the unit cube. Then the corners of the color triangle correspond to (plain) red, green and blue, from bottom left, right, to top. It is a section of the cube, with two opposite and equidistant points: black (0,0,0) and white (1,1,1). This triangle is said to be a simplex: any of its points’ coordinates sum to 1. Now the data in the triangle is obtained as (r,g,b) points, diveded by (r+g+b). It took me a while to compute the coordinates (x,y) of those points in a basis of the triangle (I did that stuff more easily back in highschool!). It should give something like that:

```x=(1-r+g)/2
y=1/sqrt(3)*((1-r-g)/2+b)```

What do we see? The colors do not look like uniformly distributed, because 1) points are much more concentrated in the center, and 2) the painter favoured red colors in comparison with green ones (very few in the bottom right corner) and blue ones (in a minor extent). Arguing aginst point 1) could be that projecting (r,g,b) points on the simplex naturally implies a higher density in the center. That is right, but it would not be that dense, as we see with uniformly simulated data:

So colors are not uniform in the RGB model. There should be a cognitive interpretation out there, no? It is not obvious that human eyes comprehend colors on the same scale as the RGB model does. If not, there is no reason for human sight to comprehend uniformity in the same way as a computer. As Pierre pointed out, what we find in the RGB model might be different in the HSV model.We’ll see this model later.

Next step, spatial autocorrelation tests?

Researcher at Inria Grenoble Rhône-Alpes

## 8 thoughts on “Random Colours (part 3)”

1. May also want to check the marginals of the contigency table. And/or, for fun, inverse the distribution function and remap the full triangle with this inverse function, to see what a world where his colors would be uniform would look like — you can apply this inverse mapping to actual pictures and enjoy “his” world 🙂

2. pierrejacob says:

Cool Julyan!

Actually looking at his wikipedia’s webpage, the painter has actually used a computer to draw colours, at least in his work for the stained-glass windows of Cologne cathedral.

http://en.wikipedia.org/wiki/Gerhard_Richter

It doesn’t give much details but I thought it was funny. We could actually try to contact the painter, he might find this series of posts entertaining. Plus if you could invite him at CREST to give a talk about art and randomness it’d be awesome!

3. Pingback: Statisfaction
4. Michaël says:

Hi,

I think there may be a problem because you don’t use the original work, but a reproduction (photography most probably) that transformed it a lot (light, color etc…). Just compare those two paintings :
http://www.gerhard-richter.com/art/paintings/abstracts/detail.php?10704
http://www.gerhard-richter.com/art/paintings/abstracts/detail.php?5780

I think both of them should have the same border, whereas the second one appears much darker.

In this case, it could be interesting to think backwards : if we know that the original distribution is uniform (according to Wikipedia), how did the photography transform the distribution ? And could we use the inverse transformation to get the real colors back on other paintings ?

5. pierrejacob says:

Hi,

indeed that would be an interesting thing to do. The problem would be that, even for 10 colours there is a huge number of paintings that would be accepted by any statistical test checking for uniformity. We would therefore have to find the painting that is the closest to the photography (according to some metric) among all the paintings that are accepted by a the test, which seems difficult to me.

Pierre