Masking question continued

This is a different question than the one in the thread “masking question”. I am revealing an image that initially is entirely covered by a mask. The code is based on the tutorial:
I want the program to know what percentage of the mask has been removed. When 90% of the mask has been removed I want it to trigger an event. Is there a simple way to do this? Any suggestions will be greatly appreciated.

Thanks so much … Michael