I have tried to make a slight modification for the Collision class from Busch2207's scenario Pixel-perfect collision detection. I want that the smaller object can be completely transparent and still check if the bounds of the smaller object is intersecting any pixel in the bigger object. I hope this makes sense.
I tried to change the line for alpha detection:
if(Ai.getColorAt(xi-x_Offset,yi-y_Offset).getAlpha()>0 && i.getColorAt(xi,yi).getAlpha()>0)
to
if(Ai.getColorAt(xi-x_Offset,yi-y_Offset).getAlpha()>0 && i.getColorAt(xi,yi).getAlpha()>=0)
This kinda works but sometimes it'll return true even though the small transparent object is not intersecting the colored part of the big object. My objects are not rotated (I don't know if this makes any difference). Can someone help me modify the code?