public static boolean hitTest (BufferedImage image, int x, int y)
    {
        // it's only a hit if the pixel is non-transparent
        int argb = image.getRGB(x, y);
        return (argb >> 24) != 0;
    }
public static boolean hitTest ( BufferedImage image , int x , int y ) { int argb = image . getRGB ( x , y ) ; return ( argb > > 24 ) != 0 ; }
Returns true if the supplied image contains a non-transparent pixel at the specified
coordinates, false otherwise.