Java JPEG 2000 Library — Read, Write & Convert JPEG 2000 Files

Read, write, and convert JPEG 2000 in pure Java, a drop-in ImageIO replacement with no native code and a maintained alternative to JAI

JDeli is a commercial, pure-Java image library that reads, writes, and converts JPEG 2000 files with no native code or third-party dependencies. It works as a drop-in ImageIO replacement and a maintained alternative to JAI. Add one JAR and your existing image code can handle the format Java dropped when Oracle discontinued JAI.

Quick Start

Add the dependency, write one line, read or convert any JPEG 2000 file. Java's ImageIO has no built-in JPEG 2000 support, so this is the part that does not work without a library.

// Add IDR Solutions repository to your pom.xml
<repositories>
   <repository>
       <id>IDRsolutions</id>
       <name>IDR Solutions</name>
       <url>https://maven.idrsolutions.com</url>
   </repository>
</repositories>

// Add JDeli as a dependency
<dependencies>
    <dependency>
        <groupId>com.idrsolutions</groupId>
        <artifactId>jdeli</artifactId>
        <version>{YYYY.MM}</version>
    </dependency>
</dependencies>
// Add IDR Solutions repository to your build.gradle
repositories {
    maven {
        url = "https://maven.idrsolutions.com"
        name = "IDRsolutions"
        credentials(PasswordCredentials)
    }
}

// Add JDeli as a dependency
dependencies {
    implementation "com.idrsolutions:jdeli:{version}"
}

JPEG 2000 Code Examples for Java

Copy-paste solutions to the problems Java developers search for: convert JPEG 2000 to JPG or PNG, read a JP2 file to a BufferedImage, write JPEG 2000, and batch convert from the command line.

// Convert JPEG 2000 to JPG
JDeli.convert(new File("input.jp2"), new File("output.jpg"));

JDeli.convert(jp2Stream, jpgStream, "jpg");

byte[] jpgData = JDeli.convert(jp2Data, "jpg");
// Convert JPEG 2000 to PNG
JDeli.convert(new File("input.jp2"), new File("output.png"));

JDeli.convert(jp2Stream, pngStream, "png");

byte[] pngData = JDeli.convert(jp2Data, "png");
// Read Jpeg 2000 files

JDeli.read(File jp2File);

JDeli.read(byte[] jp2Data);

JDeli.read(InputStream jp2Stream);
// Write Jpeg 2000 files

// To a File
JDeli.write(myBufferedImage, "jp2", new File("output.jp2"));

// To an OutputStream
JDeli.write(myBufferedImage, "jp2", outputStream);

// To a byte array (returns the encoded bytes)
byte[] jp2Data = JDeli.write(myBufferedImage, "jp2");
// Convert to and from Jpeg 2000 files
JDeli.convert(File inFile, File outFile);

JDeli.convert(InputStream inStream, OutputStream outStream, String format);

byte[] outputData=JDeli.convert(byte[] inputData, String format);
# Batch convert every JPEG 2000 file in a directory to JPG.
# Works from bash, bat, or PowerShell, and lets you call JDeli from any language that can spawn a child process.

java -jar jdeli.jar --convert jpg "inputDir" "outputDir"

Java JPEG 2000 Library Comparison

An honest comparison of the realistic ways to handle JPEG 2000 in a Java application.

Feature JDeli jai-imageio-jpeg2000 OpenJPEG binding (JNI)
JPEG 2000 read ✅ Yes ✅ Yes ✅ Yes
JPEG 2000 write ✅ Yes ⚠️ Limited ✅ Yes
Maintained ✅ Active, released every 6 weeks ❌ Effectively abandoned ⚠️ Native lib active, Java bindings vary
Works on modern Java (17, 21) ✅ Yes ❌ Breaks on recent JDKs ⚠️ Depends on binding
Cross-format convert ✅ One-line API ❌ Manual read/write ❌ Manual read/write
ImageIO compatible ✅ Drop-in plugin ⚠️ ImageIO SPI, but unmaintained ❌ Own API
Image processing ✅ Resize, crop, rotate, etc. ❌ Decode/encode only ❌ Decode/encode only
Native dependencies ❌ None (pure Java) ❌ None (pure Java) ⚠️ Native C/C++ via JNI
Deployment Single JAR Single JAR Compile/bundle native lib per platform
JVM crash risk None (runs in the JVM) None (runs in the JVM) Native faults can take down the process
License Commercial (paid) BSD-style (free) BSD 2-clause (free)
Commercial support ✅ Dedicated team, bug fixes in days ❌ None ❌ Community only

Key takeaway: Java's ImageIO has no built-in JPEG 2000 support, so the real choice is between three options. The free pure-Java continuation, jai-imageio-jpeg2000, still runs but is effectively abandoned and breaks on modern JDKs. An OpenJPEG binding works but pulls a C/C++ dependency into your deployment: a native library to build and bundle per platform, a CVE history to track, and a fault domain outside the JVM. JDeli keeps JPEG 2000 handling inside the JVM as a single, maintained JAR, at the cost of a commercial license.

JPEG 2000 Format Support in Depth

What is the JPEG 2000 format?

JPEG 2000 (ISO/IEC 15444) is a wavelet-based image format published in 2000 as a successor to JPEG, supporting both lossless and lossy compression. Files usually carry a .jp2 extension, with .j2k and .jpc used for raw codestreams. Java's ImageIO has no built-in reader or writer for it, which is why a JP2 file that other tools open fine fails in otherwise working Java code.

Why Java Lost JPEG 2000 Support

Java Advanced Imaging (JAI) was the standard way to handle JPEG 2000 in Java for years. Oracle discontinued it, leaving the open source continuation, jai-imageio-jpeg2000, effectively unmaintained and prone to breaking on modern Java versions. JDeli is a maintained, pure Java replacement that installs as a single JAR with no native dependencies.

Where JPEG 2000 Is Still Used

The format remains widely used in medical imaging, where DICOM files frequently embed JPEG 2000 compression, and in satellite and geospatial imagery. It is also the standard in digital archiving for libraries and national archives, in financial and legal document workflows, and in digital cinema, where JPEG 2000 is the DCI standard.

Reading JPEG 2000

JDeli decodes JPEG 2000 to a standard BufferedImage with a single call, reading from a byte[], File, or InputStream. Once decoded, the image is an ordinary Java object you can process, display, or write out as any other supported format.

Writing JPEG 2000

JDeli encodes a BufferedImage to JPEG 2000 and writes to a byte[], File, or OutputStream. Encoder settings give you control over lossless versus lossy output and the compression level when you need more than the defaults. The unmaintained open source alternative offers only limited write support, so this is functionality you cannot reliably get elsewhere in pure Java.

Converting JPEG 2000

The JDeli.convert() methods turn a JPEG 2000 file into JPG, PNG, or any other supported output in one call, inferring the target format from the output file extension or a format string. A command-line mode handles batch conversion of a whole directory, which is also how you invoke JDeli from a non-Java process.

Why Use JDeli over JAI and Native JPEG 2000 Libraries?

ImageIO is not in the running here because it no longer supports JPEG 2000. The real comparison is against the abandoned JAI continuation and native-backed libraries, and that is where maintained pure Java earns its place.

Maintained, unlike jai-imageio

The open source continuation has had minimal activity for years, breaks on modern Java versions, and has no roadmap to fix it. JDeli ships a release every 6 weeks with a daily pre-release jar for customers, so a JDK upgrade does not leave your JPEG 2000 support behind.

No native code to deploy

An OpenJPEG binding needs a native library present on every machine that runs your code, matched to the architecture and OS. That is a build-and-packaging problem per platform. JDeli is one JAR that runs anywhere the JVM runs, with nothing else to install.

No JVM crashes from native faults

A JNI bridge runs outside the JVM's memory safety model. A fault in the native JPEG 2000 layer can bring down the entire Java process, not just throw an exception you can catch. JDeli runs inside the JVM, so a malformed file gives you an exception, not a dead process.

Smaller security surface

Unmaintained libraries show up as unsupported software in customer security assessments, even before a CVE is issued, and native C/C++ codecs pulled in through JNI carry their vulnerabilities into your stack. JDeli is maintained and makes no calls to native code, so JPEG 2000 parsing stays within Java's managed memory model.

No code rewrite

JDeli ships as an ImageIO plugin. Existing code written against ImageIO.read() and ImageIO.write() picks up JPEG 2000 support without changing the calls.

Read and write in one library

JDeli reads and writes JPEG 2000 through the same API you use for every other format, so consuming archived JP2 files and producing new ones are the same two method calls rather than two separate toolchains.

Already using ImageIO?

Java developers that once relied on JAI's ImageIO integration for JPEG 2000 lost it when the library was discontinued.
JDeli can effortlessly restore JPEG 2000 to ImageIO with our plugin — your existing image-handling code stays exactly the same!

Trusted by Companies around the World

Abacus logo
Citi logo
Clearsense logo
Honeywell logo
Los Alamos National Lab logo
Mercedes-Benz Bank logo

Frequently asked questions

Does Java ImageIO support JPEG 2000?

No. Oracle removed JPEG 2000 support from Java when JAI was discontinued. JDeli adds it back via an ImageIO plugin. Drop in the JAR and your existing ImageIO.read() / ImageIO.write() calls gain JPEG 2000 support without code changes.

Are there free Java libraries for JPEG 2000?

The main free option is jai-imageio-jpeg2000, the open source continuation of JAI. It has had minimal maintenance for years and breaks on modern Java versions.

Can I convert a PDF to JPEG 2000 in Java?

JDeli does not read PDF files. To convert PDF pages to JPEG 2000 in Java, use JPedal. See Convert PDF to JPEG 2000 in Java.

How do I convert JPEG 2000 to JPG in Java?

Call JDeli.convert(new File("input.jp2"), new File("output.jpg")). JDeli infers the output format from the file extension. See Convert JPEG 2000 to JPG in Java for a full example.

How do I convert JPEG 2000 to TIFF in Java?

Call JDeli.convert(new File("input.jp2"), new File("output.tiff")). JDeli infers the output format from the file extension. See Convert JPEG 2000 to TIFF in Java for a full example.

Why use JDeli for JPEG 2000 image support?

1.

Adds JPEG 2000 to ImageIO so works with existing code

2.

Reads and writes JPEG 2000 with no native code or third party libraries

3.

Actively maintained, unlike JAI, so it won't break when you upgrade your JDK

Try JDeli for Free