code: public static void write(Image image, String dest, boolean writeAlpha) throws SlickException {
  		try {
  			int ext = dest.lastIndexOf('.');
  			if (ext < 0) {
  				throw new SlickException("Unable to determine format from: "+dest);
  			}
  			
  			String format = dest.substring(ext+1);
  			write(image, format, new FileOutputStream(dest), writeAlpha);
  		} catch (IOException e) {
  			throw new SlickException("Unable to write to the destination: "+dest, e);
  		}
  	}
docs: Write an image out to a file on the local file system. The format of the output
  is determined based on the file name extension
  
  @param image The image to be written out
  @param dest The destination path to write to
  @param writeAlpha True if we should write the alpha channel out (some formats don't support this, like JPG)
  @throws SlickException Indicates a failure to write the image in the determined format