* BufferedImage as needed
*/
public void encodeImage(BufferedImage buf, File imageFile){
try{
OutputStream os = new FileOutputStream(imageFile);
ImageEncoder encoder = new PNGImageEncoder(os, null);
encoder.encode(buf);
os.flush();
os.close();
}catch(IOException e){
throw new Error("Could not write imageFile: " + imageFile.getName());
}