//Convert the decoded bitmaps to a BufferedImage
BufferedImage bufImage = createBufferedImageFromBitmaps(fopImage);
ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor("image/png");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
writer.writeImage(bufImage, baout);
rawData = baout.toByteArray();
}
if (rawData == null) {
log.warn(FONode.decorateWithContextInfo("Image could not be embedded: "
+ fopImage.getOriginalURI(), abstractGraphic));
return;