JPEG 2000 libraries for Java
The JDK’s ImageIO has no JPEG 2000 reader. The common open-source option is:
- jai-imageio-jpeg2000: a pure Java ImageIO plugin based on JJ2000, the Java reference implementation. Add it to the classpath and
ImageIO.readopens.jp2and.j2kfiles. Apache PDFBox uses it to decodeJPXDecodeimages in PDF files. It’s no longer developed, and the JJ2000 license isn’t GPL-compatible.
Other options: imageio-ext has ImageIO plugins that call Kakadu (commercial) or GDAL; Grok ships SWIG Java bindings (AGPL-3.0); calling OpenJPEG through JNI or the Panama FFM API is another route when you need speed.
- jai-imageio-jpeg2000 jai-imageio-jpeg2000 is a pure Java ImageIO plugin that reads and writes JPEG 2000. How to add it with Maven or Gradle, read JP2 files, write lossless.