I am able to compress an image file using the jbig2.exe encoder.
I can easily execute the jbig2.exe
from the command line ex: >jbig2.exe
C:\images\image.jpg.
However I am trying to write a Java code that will invoke the jbig2.exe
using a ProcessBuilder
.
Now the image I have is a RenderedImage and I am getting confused over how to give it as input to the ProcessBuilder. Ex :
void encoder_to_jbig2(RenderedImage image) throws Exception{
ProcessBuilder pb = new ProcessBuilder();
pb.command("jbig2.exe");
Process p = pb.start();
OutputStream os = p.getOutputStream();
Thanks.