I need to do a dynamic mask between two images that works as explained:
- I have two images of the same size
- I have a third image that is a mask made of different sprites (that will be animated) that have just two colors, first color means first image and second color means second image
What I would like to do is to draw the just pixels of the first image if the corresponding pixel of the mask is of the first color and the pixels of the second image otherwise. Which is the most performance wise approach to this problem? (I mean if there is a way to not do it by directly manipulating pixels (through the corresponding int[]) also if it sounds to be the most performant solution, unless something already present inside the core API is available)