How to Equally Blend Multiple Images in GIMP

Warning! Some information on this page is older than 5 years now. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.

Aug 2010

During my today's walk on Warsaw I took many different photos. Some of them were series of photos of a road from exactly same place, with a purpose of merging them together into a single photo. My idea was to just average the color of each pixel, so it should be like:

out = 1/4 * (img[0] + img[1] + img[2] + img[3])

But how to do this in GIMP? There is no such filter AFAIK. An obvious solution is to use blending - Mode and Opacity settings for layers - but it turns out to be not so simple. Each layer blends with a merged image from beneath it, so instead of average formula above we have to refer to a formula for blending (linear interpolation), which is:

out[i] = t[i] * img[i] + (1-t[i]) * out[i+1]

i is a layer index 0..(n-1), indexed from the topmost layer,
t[i] is Opacity parameter for layer i.

After expanding it for 4 layers, the formula becomes:

out =
t[0] * img0 + (1-t[0]) * (
  t[1] * img1 + (1-t[1]) * (
    t[2] * img2 + (1-t[2]) * (
      t[3] * img3 + (1-t[3]) * 0

Finally, after doing some math with pen and paper, I calculated that to equally blend (average) n images in GIMP, you should:

For example, I have 5 photos so I give them Opacity: 20, 25, 33, 50, 100. Here is the result: an image that could be called "Road of Ghosts" :)

By the way, I've found a website where panorama photos can be uploaded for free and interactively viewed using just Flash. Here is my profile: reg | Panogio.

Comments | #gallery #graphics Share


[Download] [Dropbox] [pub] [Mirror] [Privacy policy]
Copyright © 2004-2020