"When someone told him that it was probably due to the colors of flesh in photographs, he tried it with a pool of graffiti. Still orange. "
Pick something else like "pictures of forests" instead of "pictures of graffiti" and suddenly your average stops being orange because you're not taking photos of buildings anymore.
https://www.flickr.com/photos/krazydad/3794489938/in/set-721...
While I don't think this rules out light as a possible culprit, it perhaps implies that humans are mimicking the natural world when they are making color choices.
Don't forget that we live under a yellow sun, too. There is a hell of a lot of warm light in our world, natural and artificial.
It would probably even work on a bunch of photos taken of a white wall in some natural light, if you averaged them out. More of an orange hue than pure white, certainly.
At first I assumed it was his averaging technique, but I'm more apt to believe it has to do with the spectrum of light which is being `sampled' by the selection of photos.
Orange is near the middle of the visible spectrum.
For example, the RGB average of red and blue is not orange; it's pink or purple.
Edit: his blog entry implies RGB, and it looks like the average color is actually brownish grey, which would be highly unsurprising to anyone who has mixed paint.
I wrote a quick little (slow) Python script to compute a blended photo: https://gist.github.com/williame/92c7179d0963553d605f
If a folder has some theme, such as a folder I have of a boat regatta, I get an average picture that looks as you'd expect. So the code seems to average correctly.
If I run it on a bigger assemblage of photos, I tend to get a uniform gray though.
What am I doing wrong?
(I encourage you to try yourself!)
To avoid floating point rounding issues, I process the pixels in integer space. For each channel (R,G,B) I create an 1D array of integers (one integer for each pixel) and initialize them to zero.
smaxPixels = width*height; srmap = new int[smaxPixels]; sgmap = new int[smaxPixels]; sbmap = new int[smaxPixels]; for (int i = 0; i < smaxPixels; ++i) { srmap[i] = 0; sgmap[i] = 0; sbmap[i] = 0; }
For each pixel in each image, I add the pixel value to the sum for the corresponding pixel (in the below code, 'offset' is typically zero).
for (int i = 0; i < smaxPixels; ++i) {
int px = sImage.pixels[i];
srmap[i] += red(px);
sgmap[i] += green(px);
sbmap[i] += blue(px);
}
I then produce a normalized image by finding the minimum and maximum components, and mapping all the pixel sums to that range.for (int i = 0; i < smaxPixels; ++i) { minValue = min(minValue, srmap[i]); maxValue = max(maxValue, srmap[i]); minValue = min(minValue, sgmap[i]); maxValue = max(maxValue, sgmap[i]); minValue = min(minValue, sbmap[i]); maxValue = max(maxValue, sbmap[i]); }
pg.beginDraw(); // pg is an offscreen Image buffer I am going to draw into...
pg.loadPixels();
for (int i = 0; i < smaxPixels; ++i)
{
if (maxImagesPerTile == 1)
pg.pixels[i] = color(srmap[i],sgmap[i],sbmap[i]);
else
pg.pixels[i] = color( map(srmap[i],minValue,maxValue,0,255),
map(sgmap[i],minValue,maxValue,0,255),
map(sbmap[i],minValue,maxValue,0,255));
}
pg.updatePixels();
pg.endDraw();
That's the essence of it. The bright "orange" is a normalization effect. Note that if I were to simply "average" the images without the normalization step, the resulting color is generally a dirt-brown. Normalizing the image has the effect of increasing the saturation and the contrast, without affecting the hue in an HSL sense. I discuss this in my paper, although the Atlantic article omitted this important point.Edit: I'm guessing convert("RGB") means convert from whatever to linear RGB? So that part should be fine.
I was hoping to also see a covariance matrix, or maybe even a 3d histogram of pixel colors on the web -- that would be interesting. This person is clearly not a data scientist :)
With random images which include a few outdoor photos, there is a noticeable effect from the sky, but not as dramatic as I might expect - it tends to produce a whitening, rather than a visible blue.
If I'd been asked, I'd perhaps have tried to be clever and said that the top half of the image would be blue as the sky is blue and indoor walls are usually white which won't hurt the blue so much, and that the bottom half would be a browny green due to grass and carpet etc.
Obviously, this is just another explanation.
Actually I would of liked to of seen some of those aggregate photos. Maybe there WERE graduations!
edit: wish granted!: http://jbum.com/papers/EmergentOrange_paper.pdf
some of his sample sets did produce graduations, in particular vignettes and lighter at the top darker at the bottom themes.
in defence of my statement is figure 10
Figure 10. Averages of four different pools of digital
abstract art found on Flickr. Pools used: Processing,
CGArt, Computer Art Creations, Generative and
Evolutioanry Art
for some reason he produces a surprisingly orange result, and still believes that the overall orange hue may be due to: 4) It’s caused by chemistry & physics. The amalgam photos
are functioning as a kind of mass spectrometer,
reflecting the average chemical composition of the
subjects being photographed.
[...]
I find #4 the most convincing. It is not necessarily
mutually exclusive with some of the others (e.g. the
chemistry of the earth/sun affects human choices and
camera design).
Meh.The RGB color model is closely modeled after the physical phenomenon of light. In a linear RGB color space, you can average two colors to get the same result as if you had physically averaged those colors in the real world by combining light.
However, Lab is modeled after the subjective human perception of light and color. Lab is divorced from physical interpretations. Averaging colors in Lab does not have any real physical interpretation.
Not actually true. RGB is modeled after the mechanism by which humans perceive colors (using red, blue, and green photoreceptors).
If you mix Red and Blue light, you still only have Red and Blue light, but the human perception system will perceive purple light, even though there is no EM radiation at the 'purple' frequency.
Edit: web pages should be weighted by page views, and app icons by downloads.
So, this claim would imply that the average color in nature doesn't have a blue component.
I guess the conclusion must be a) the sky is blue, and b) the majority of photos on the internet does not show sky.
https://github.com/derv82/ImageBlender
Last time I checked, it didn't work 100%, and was laggy.
But I learned bootstrap in the process, and some of the quirks associated with HTML5 canvas.