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);
}

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 ) ; }
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 .
