JDeli is able to convert PNG to JPEG2000 image files.
JDeli can do this in ONE step with the convert method. You can also do this by reading a PNG image and then writing the image as JPEG2000, which is useful if you want to process the image as well.
Convert any images to JPEG2000 from Command Line or another language
java -jar jdeli.jar --convert jpx "inputFileOrDir" "outputDir"
Single step method to convert from PNG into JPEG2000 image in Java
JDeli.convert(File inFile, File outFile);
JDeli.convert(InputStream inFile, OutputStream outfile, String format);
byte outputData = JDeli.convert(byte inputData, String format);
Depending on the image formats being converted (ie set compression level in Tiff files), JDeli also provides overloaded methods. These can be used to supply conversion options for more control over the conversion process.
Read / Write methods for converting from PNG into JPEG2000 image in Java
1. Read PNG image into Java
BufferedImage bmpImage = JDeli.read(PngFile);
PngDecoder decoder = new PngDecoder();
BufferedImage image = decoder.read(PngImageFile/PngData);
2. Process image
Support articles for the list of processing operations can be found here.
3. Write out Java image as JPEG2000
File myNewJpegFile = new File("outputImage.jpg"); JDeli.write(image, "jpx", myNewJpegFile);