protected void savePNGImage(String filename,BufferedImage image) throws IOException {
  File file=new File(filename);
  ImageIO.write(image,"png",file);
}

protected void savePNGImage ( String filename , BufferedImage image ) throws IOException { File file = new File ( filename ) ; ImageIO . write ( image , "png" , file ) ; }
saves an image as png .
