How can I save an image to disk in a standard image format?
Created Oct 28, 2001
John Zukowski The javax.imageio package provides this for you in Java 1.4. Previousl versions had no standard support, though you could add third party libraries to standard Java for this.
BufferedImage output = new BufferedImage (width, height,
BufferedImage.TYPE_INT_ARGB);
// fill image
// Save
File outputFile = new File("image.png");
ImageIO.write(output, "PNG", outputFile);