You can save a BufferedImage
object using write method of the javax.imageio.ImageIO
class. The signature of the method is like this:
public static boolean write(RenderedImage im, String formatName, File output) throws IOException
Here im
is the RenderedImage
to be written, formatName
is the String containing the informal name of the format (e.g. png) and output
is the file object to be written to. An example usage of the method for PNG file format is shown below:
ImageIO.write(image, "png", file);