BufferedImage img = .... public boolean isTransparent( int x, int y ) { int pixel = img.getRGB(x,y); if( (pixel>>24) == 0x00 ) { return true; } return false; }
Of course, img must be in the correct TYPE_4BYTE_ABGR format or in some format that supports alpha channels, otherwise it will always be opaque (i.e. 0xff).
source share