static BWImage getAlphaChannel(BufferedImage src) { //assertEquals("Wrong image type", BufferedImage.TYPE_INT_ARGB, src.getType()); int w = src.getWidth(); int h = src.getHeight(); int[] srcBuffer = src.getData().getPixels(0, 0, w, h, (int[]) null); BWImage alpha = new BWImage(w, h); for (int i=0; i> 24) & 0xff; //int a = srcBuffer[i] & 0xff; alpha.setByte(i % w, i / w, a); //print(intToHex(srcBuffer[i])); } ret alpha; }