Can we request for a version of your code that uses single images rather than array so it will be easier to understand it please.
The code already has methods for both single images and arrays of images:
static public int createPixelMasks(Image spriteImages, GraphicsConfiguration gc)
static public int createPixelMask(Image spriteImage, GraphicsConfiguration gc)
And then the actuall collision detection acts on two masks which have to be arrays for the code to work:
public final static boolean maskCollision(int mask1, int x1, int y1, int width1, int height1,
int mask2, int x2, int y2, int width2, int height2)
basically the masks are simply bits representing each pixel in the images to check for a collision. The bits are on for pixels that can collide and off for pixels that can't.
I should note that this code is based heavy one another persons work, although I can't remember who it was. I think he used to be a member here.