0

I need to convert a 8 bit png image into 24 or 32 bit png.

I understand the corresponding image magic command to convert this is:

convert test.png PNG24:test2.png

What ImageOperation property should be used to pass PNG24 argument to convert the image to 24 bit.

I have the current java code snippet something like below:

IMOperation op = new IMOperation();
                op.addImage();
                op.background("none");
                op.autoOrient(); 
                 op.addImage();
               //What should I add for converting it to a PNG24 format???
                convert.run(op,sourceFile,destFile);

The input image is a 8 bit png.

Surya
  • 236
  • 2
  • 13
  • Change the contents of `destFile` so it starts with `PNG24:` maybe? Or maybe not have a `background` of `none` which will require transparency which isn't going to fit in 24 bits. – Mark Setchell Oct 22 '15 at 21:05
  • Removed the background none and that too did not help – Surya Oct 22 '15 at 21:30

1 Answers1

1

After some research this is what I did to fix it.

IMOperation op = new IMOperation();
                op.addImage();
                op.background("none");
                op.autoOrient(); 
                 op.addImage();
                //Added the following line to fix it
                destFile = "png32:"+destFile;
                convert.run(op,sourceFile,destFile);
Surya
  • 236
  • 2
  • 13