public void save(File file,String type) throws IOException {
  final FileOutputStream fos=new FileOutputStream(file);
  ImageIO.write(this.image,type,fos);
  fos.close();
}

public void save ( File file , String type ) throws IOException { final FileOutputStream fos = new FileOutputStream ( file ) ; ImageIO . write ( this . image , type , fos ) ; fos . close ( ) ; }
save the image to a file
