Mask Transitions Help

Hey anyone tell me how to create this mask transition?

The example is in here:

The top left area with 5 different images transitioning. Thats exactly the effect I am looking at, with 4 different buttons to click on and change the image.

Another example:

Please help