private void updateAnnotations(BufferedImage image) {
Graphics graphics = image.getGraphics();
ArrayList<Annotation> annotations = imagePanel.getAnnotations();
for (int i = 0; i < annotations.size(); i++) {
Annotation a = annotations.get(i);
a.drawDecoration(graphics, i, false);
}
}
private ImageWriter getPNGImageWriter() {
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("png");