code: public static BufferedImage createCopy(final BufferedImage pImage) {
          if (pImage == null) {
              throw new IllegalArgumentException("image == null");
          }
  
          ColorModel cm = pImage.getColorModel();
  
          BufferedImage img = new BufferedImage(cm,
                                                cm.createCompatibleWritableRaster(pImage.getWidth(), pImage.getHeight()),
                                                cm.isAlphaPremultiplied(), null);
  
          drawOnto(img, pImage);
  
          return img;
      }
docs: Creates a deep copy of the given image. The image will have the same
  color model and raster type, but will not share image (pixel) data
  with the input image.
  
  @param pImage the image to clone.
  
  @return a new {@code BufferedImage}
  
  @throws IllegalArgumentException if {@code pImage} is {@code null}