I'm trying to copy in three new BufferedImage the same BufferedImage content, this is my code:
ColorModel cm = image.getColorModel();
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
WritableRaster raster = image.copyData(null);
BufferedImage[] images = {
new BufferedImage(cm, raster, isAlphaPremultiplied, null),
new BufferedImage(cm, raster, isAlphaPremultiplied, null),
new BufferedImage(cm, raster, isAlphaPremultiplied, null)
};
Even if I'm editing these images in distinct ways, the result is the same. I'm sure it's all ok because the code work properly if I have only one copy, but not more than one.
How can I manage something like this?