* @throws IOException in case of an I/O problem
*/
public static void saveAsPNG(BufferedImage bitmap, File outputFile) throws IOException {
OutputStream out = new FileOutputStream(outputFile);
try {
PNGImageEncoder encoder = new PNGImageEncoder(
out,
PNGEncodeParam.getDefaultEncodeParam(bitmap));
encoder.encode(bitmap);
} finally {
IOUtils.closeQuietly(out);
}
}