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 can 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 exported samples with mutually inverse backgrounds and expected result (from technique/plugin I'm seeking in this question):  
![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?**


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