Applying multiple masks to an image and changing mask modes