Mask

How to make such a mask? Is this done programmatically or in some program a video is created with a mask like this?

Mask is an option in the program itself and the program has some default masks you can use.

Inside the options for Picture or Background there is the option for Animation.
Changing this option to Mask and then selecting a mask image will allow you to have the same effect as the gif you linked. Play around with the different default masks and the "Vague" (which adjusts the smoothness of the mask) option to get some pretty interesting effects.
I tried different masks, they are very good. But there is no "close / open eyes" GIF file itself. That's why I wanted to ask where can I get this file or can I download it somewhere? Or do you need to create it yourself?
I believe you would need to create an oval image yourself for that particular effect (there is a circle but I don't think it would work the same way).

Original thread: https://forums.rpgmakerweb.com/threads/mask.132919/