4

With two images, it's easy to merge them together such that each image contributes an equal amount of Hue / Saturation / Value. I simply overlap the two layers, and set the above one to be at 50% opacity.

But how can I do this with THREE images? If I overlap three images, and set the above two to 50% opacity, then the contributions of the three images are not equal, and the top image ends up contributing slightly more.

I have attached an example illustration to help convey my conundrum:

enter image description here

The reasons for why I would like to do this is because:

  1. I think it's fun to experiment with image manipulators and I am curious if it's possible to do this in GIMP.
  2. I would like to combine the results of multiple "AI colorizers" together in order to create an amalgamate image, but for each image to make an equal contribution to get a true average
  3. Reduce the noise of a photograph by merging multiple images of the same subject taken in quick succession.

edit: I should note that if I had four images to combine, it becomes easy to do so, because I could simply combine them in pairs, then combine the two results, like so: (A+B)+(C+D)

6
  • You also have the same situation with 2 colors, so your first statement is incorrect. Have you tried other blending modes?
    – Luciano
    Apr 24 at 10:21
  • But I don't have this issue with two colors? Whether red or green is on top, the resulting color is "hex bcbc00" if the top layer is at 50% opacity. I have tried all the blending modes in Gimp, and none provide the result I am looking for. I have found a somewhat inelegant solution, where I set the middle layer to 50%, and the top layer to 33.3%. The resulting color is perfectly gray, indicating that all three layers have made an equal contribution. I would like to leave the question open for a solution that works well with a great deal of images though. Apr 24 at 11:04
  • The "inelegant solution" is the correct one (and IMHO mathematically elegant). The opacity goes 100%, 50%, 33.3%, 25%, 20% (or 1/1, 1/2, 1/3, 1/4, 1/5) and so on. This can be easily scripted if there are a lot of layers Apr 24 at 16:34
  • The idea of doing it manually was what I thought inelegant. Apr 24 at 17:56
  • True, everything that can be automated is inelegant when done manually :) Apr 24 at 18:32

3 Answers 3

4

To expand on @10 cents per kWh answer (which is correct), this is how layer opacity stacks if you want them to have equal weight in the composite image:

Layer Opacity You see
6 16.7% 16.7% top layer + 16.7% each layer below (83.3% split between 5 layers = 16.7%)
5 20% 20% top layer + 20% each layer below (80% split between 4 layers = 20%)
4 25% 25% top layer + 25% each layer below (75% split between 3 layers = 25%)
3 33.3% 33.3% top layer + 33.3% each layer below (66.6% split between 2 layers = 33.3%)
2 50% 50% top layer + 50% bottom layer (100% of 50% = 50%)
1 100% 100% of the single layer

Note: For this to work, each layer must have the opacity specified in the table, in the order given.

2
  • Shorter to describe it as opacity= 1/position_from_bottom
    – xenoid
    Apr 24 at 21:55
  • Then in Python: for pos,layer in enumerate(reversed(image.layers),1): layer.opacity=(100./pos)
    – xenoid
    Apr 24 at 22:02
3

Let the top layer have opacity = 33%. Let the mid layer have opacity = 50%. Let the bottom layer have opacity = 100%.

This is not especially handy if you want to test with different images. But you can have a layer group for each transparency. Move a fully opaque layer to the top group which has 33% opacity. Move a layer to the mid group which has 50% opacity.

2
  • I'll accept your answer as the solution, but I'd like to mention another solution someone shared with me on Reddit that can make this process more convenient if you have a great deal of images. By installing a plugin called G'MIC, you can go to filters -> G'MIC-Qt... -> Layers -> Blend [Average All], and set the colorspace to "Linear RGB" it seems you can achieve the same effect with a single click. Apr 24 at 17:44
  • 3
    @theron.rilee Seriously: Write the method using G'MIC package as a new answer and give the accepted mark to it. It would be useful for those who one day want to make the average of several layers instantly. Tinkering with opacities is.....tinkering. I made an edit suggestion to help the process. Apr 24 at 21:01
0

The answers here are short and to the point, but I thought I'd expand a little on the why.

If you have one layer, it should all show, so set your bottom layer to 100%.

If you add another layer, you want to evenly blend that with the layer below, so set it to 50%. Now each layer contributes 1/2.

If you add another layer, it should only contribute 1/3, so set it to 33.33%. The other 2/3 consists of the evenly blended bottom 2 layers, so they each contribute 1/3 also.

If you add another layer, it should only contribute 1/4, so set it to 25%. The other 3/4 consists of the evenly blended bottom layers, so they each contribute 1/4 also.

And so on...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.