Few time ago I was researched for Visual Basic's blending method to found better method to correctly generate alpha-channel of image to make displaying of sprites which correctly displaying in the SMBX.
You can look for this implementation here:
https://github.com/Wohlhabend-Networks/ ... cs.cpp#L53
You can check them in action in the editor before I will make update of my lazy-fix tool:
in the laboratory available update which have new menu item in the "View" menu, but you will see result after reloading of file.
Examples:
This is a typical lazily-made sprite and mask pair:


and it's result:
But graphics like this:


will give full transparency, because color or mask mapping to alpha-channel:
When you enable special flag:
and when you will reload level, you will see magic:
Now about algorithm:
I looked for VB's drawing method: it apply bitwise "AND" operation between RGB's while draw mask to background image, and after apply bitwise "OR" operation while draw image over mask.
I made similar operation for image sprite over gray background to unmask. But how I made right transparency?
1) I mapped mask into alpha-channel by normal method (result like "AND")
Alpha = 255 - ((R+G+B)/3) //if Alpha 0 - transparency, if 255 - solid
2) After I made same operation but with pixels of source image and gotten value I was appended to already generated alpha-channel. (result like "OR")
Alpha = Alpha+((R+G+B)/3)
and this method will fix any lazily-made graphics which was correctly shown in the SMBX but wrongly shown in the PGE.
I will update my lazy-fix tool and will apply THIS method to generate RIGHT mask.
P.S.
Without "VB Emulation" flag ('GFX Fix'):
(Because masks are have completely white pixels, lights are invisible here)
With "VB Emulation" flag ('GFX Fix'):
(Instead of simple mapping of mask to alpha-channel, was run this algorithm of calculating target color & alpha-channel )
And do you remember those goombas from this
http://engine.wohlnet.ru/forum/viewtopic.php?f=5&t=158 test?

If you will enable this algorithm same goombas will have this view:

Unlike SMBX where mask drawing to screen over background and other objects and after sprite drawing over drawn mask, sprites generating by once into memory and masks no more using. This save lots of memory and giving better CPU speed.