I'm wondering if there is a way to **automatically calculate transparent image from set of non-transparent ones.** No manual work with individual pixels or manual setting of opacities.

Many times I need to export images from 'image editors' which are not supporting transparent backgrounds (example: PowerPoint). I can still give the image any background. For example I'm able to export two samples with mutually inverse backgrounds (as seen on 2 samples below). Or I can create 3-5 images with backgrounds for example: red, green, blue, white, black.

Example:  
2 samples with mutually inverse backgrounds leading to expected result (I'm seeking technique/plugin to get such a result):  
![enter image description here][2]

With such a set, **based on differences between samples** it should be completely clear what pixel has what alpha value.

**Is there a technique/plugin converting set of samples described above into single image with correctly derived transparency?**

I prefer GIMP.

  [2]: https://i.sstatic.net/TujWG.png