code: public static void saveImage(Image image, String filename, String imgFileFormat){
  		File f = new File(filename);
  		if(!f.isDirectory()){
  			saveImage(image, f, imgFileFormat);
  		} else {
  			throw new ImageSaverException(new IOException(String.format("provided file name denotes a directory. %s", filename)));
  		}
  	}
docs: Saves image using {@link #saveImage(Image, File, String)}.
  @param image to be saved
  @param filename path to file
  @param imgFileFormat image file format. Consult {@link #getSaveableImageFileFormats()}
  @throws ImageSaverException if an IOException occured during
  the process, the provided filename path does refer to a directory or no
  appropriate writer could be found for specified format.
  @since 1.0