Java examples for 2D Graphics:BufferedImage Create
save Image
//package com.java2s; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; public class Main { public static void saveImage(String filename, BufferedImage image) { File file = new File(filename); try {//from w ww . j a v a 2 s.c om ImageIO.write(image, "png", file); } catch (Exception e) { System.out.println(e.toString() + " Image '" + filename + "' saving failed."); } } }