public static Bitmap convert(BufferedImage image) {
            
    	Bitmap result = new Bitmap(image.getWidth(), image.getHeight());
    	
    	image.getRGB(0, 0, image.getWidth(), image.getHeight(), result.pixels, 0, image.getWidth());
    	
        image.flush();
        
        return result;
    }