The following post explains how to produce BufferedImage from HTML:
pd4ml-html-css-pdf-tips-tricks-f7/html-to-image-conversion-with-pd4ml-t39.htmlAfter that you may save the image to PNG, JPEG etc. For some image formats you would probably need JAI library.