If you need a copy of a BufferedImage
, you could do something like this:
final BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
final Graphics2D g = dst.createGraphics();
g.drawImage(src, 0, 0, null);
g.dispose();
However, depending on what exactly you’re doing, you might want to do all of this inside an ImageOp
so that the images you’re producing are in the image cache. It’s hard to be more specific without seeing the surrounding code for context.
BTW, we could use some help with converting pages in the current module library to the new one which will replace it.