How to save a BufferedImage as a File
I am using the imgscalr Java library to resize an image . The result of a resize() method call is a BufferedImage object. I now want to save this as a file (usually .jpg). How can I do that? I want to go from BufferedImage -> File but perhaps this is not the correct approach? File outputfile = new File("image.jpg"); ImageIO.write(bufferedImage, "jpg", outputfile); Raj Adroit 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