static void clearImage(BufferedImage img){
  Graphics2D g2=img.createGraphics();
  g2.setComposite(AlphaComposite.Clear);
  g2.fillRect(0,0,img.getWidth(),img.getHeight());
  g2.dispose();
}

static void clearImage ( BufferedImage img ) { Graphics2D g2 = img . createGraphics ( ) ; g2 . setComposite ( AlphaComposite . Clear ) ; g2 . fillRect ( 0 , 0 , img . getWidth ( ) , img . getHeight ( ) ) ; g2 . dispose ( ) ; }
clear a transparent image to 100 % transparent
