I've added a last step to improve the color blending.
In the
previous screenshot, there was still some weirdness in darker areas.
Now, in this
new screenshot the contrast is more faithful.
Now I don't see anything else to improve in this specific test case, and in all my tests through several other maps this algorithm also seems optimal... except for one thing: I've found out that it's only optimal at 50% translucency. I'll have to do some tests to figure out exactly what needs to be compensated from one blending level to another, but I'll leave that for later.
Also, I want to thank MFX for his Clean Cut map, which was really helpful to test and improve the color blending. Those flat-colored gray color windows served as a good neutral ground for figuring out which properties of the colors were being distorted, and how.