I recently discovered that the ImageIO library I was using was writing images to byte arrays/streams incredibly slowly and switched from
BufferedImage img;//initialized elsewhere
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img,"png",baos);
to
BufferedImage img;//initialized elsewhere
byte[] argb = ((DataBufferByte) img.getRaster().getDataBuffer()).getData();
While this second method is almost 70 times faster, I cannot find a quick way to recreate a BufferedImage from this argb byte array.