question: public static void exportToJPG ( OutputStream os , NLPCanvasRenderer renderer , NLPInstance instance , double scaleFactor ) throws IOException { BufferedImage image = getImage ( renderer , instance , scaleFactor ) ; ImageIO . write ( image , "JPG" , os ) ; }
target:  Export to JPG. For some reason the background comes out pink, I have no idea why. Note that this method /does not/ close the outputstream after writing, this is up to the caller.