Here you can find the source of DuplicateBufferedImage(BufferedImage bi)
public static BufferedImage DuplicateBufferedImage(BufferedImage bi)
//package com.java2s; // LICENSE: This file is distributed under the BSD license. import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.WritableRaster; public class Main { public static BufferedImage DuplicateBufferedImage(BufferedImage bi) { ColorModel cm = bi.getColorModel(); boolean isAlphaPremultiplied = cm.isAlphaPremultiplied(); WritableRaster raster = bi.copyData(null); return new BufferedImage(cm, raster, isAlphaPremultiplied, null); }//from www . ja va2 s. c o m }