Java AVIF Library — Read, Write & Convert AVIF Files

Read, write, and convert AVIF in pure Java, a drop-in ImageIO replacement with no native code and dedicated support

JDeli is a commercial, pure-Java image library that reads, writes, and converts AVIF files with no native code or third-party dependencies. It works as a drop-in ImageIO replacement. Add one JAR and your existing image code can produce and consume the format Java has no built-in support for.

Quick Start

Add the dependency, write one line, read or convert any AVIF file. Java's ImageIO has no AVIF 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}"
}

AVIF Code Examples for Java

Copy-paste solutions to the problems Java developers search for: read AVIF to a BufferedImage, convert AVIF to JPG, write AVIF, and batch convert from the command line.

// Convert AVIF to JPG
JDeli.convert(new File("input.avif"), new File("output.jpg"));

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

byte[] jpgData = JDeli.convert(avifData, "jpg");
// Batch convert a directory of images to AVIF from the command line.
// Also how you call JDeli from any language that can spawn a process.

java -jar jdeli.jar --convert avif "inputFileOrDir" "outputDir"
// Convert to and from AVIF files
JDeli.convert(File inFile, File outFile);

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

byte[] outputData=JDeli.convert(byte[] inputData, String format);
// Read AVIF files

JDeli.read(File avifFile);

JDeli.read(byte[] avifData);

JDeli.read(InputStream avifStream);
// Write AVIF files

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

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

// To a byte array (returns the encoded bytes)
byte[] avifData = JDeli.write(myBufferedImage, "avif");

Java AVIF Library Comparison

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

Feature JDeli ImageMagick wrapper (JNI/CLI) libavif binding (JNI)
AVIF read ✅ Yes ✅ Yes (if AVIF delegate installed) ✅ Yes
AVIF write ✅ Yes ⚠️ Depends on build ✅ Yes
Cross-format convert ✅ One-line API ⚠️ Shell out / manual ⚠️ Manual read/write
ImageIO compatible ✅ Drop-in plugin ❌ Own API / process calls ❌ Own API
Image processing ✅ Resize, crop, rotate, etc. ✅ Extensive ❌ Decode/encode only
License Commercial (paid) Apache 2.0 (free) BSD 2-clause (free)
Native dependencies ❌ None (pure Java) ⚠️ Native binary + delegates ⚠️ Native C/C++ via JNI
Deployment Single JAR Install binary on every host Compile/bundle native lib per platform
JVM crash risk None (runs in the JVM) Native faults can take down the process Native faults can take down the process
Commercial support ✅ Dedicated team, bug fixes in days ❌ Community only ❌ Community only

Key takeaway: ImageIO cannot read or write AVIF at all, so the real choice is between a pure-Java library and a native-backed one. ImageMagick and libavif bindings work, but both pull a C/C++ dependency into your deployment: a binary to install on every host, a fault domain outside the JVM, and a per-platform build to maintain. JDeli keeps AVIF handling inside the JVM as a single JAR, at the cost of a commercial license.

AVIF Format Support in Depth

What is the AVIF format?

AVIF (AV1 Image File Format) stores a still image compressed with the AV1 video codec inside the same ISO base media container used by MP4 and HEIF. It was published in 2019 and is designed for the web, where its main draw is much smaller files at comparable quality. Java's ImageIO has no reader or writer for it, so an AVIF asset that a browser displays fine will fail in otherwise working Java code.

Why Use AVIF on the Web

AVIF's compression is its reason to exist: the AOMedia project reports it delivers at least 30% better compression than the alternatives it competes with. Smaller images mean faster page loads and less bandwidth, which is why AVIF shows up in image pipelines that serve responsive web assets. JDeli lets a Java backend generate those assets directly instead of shelling out to a separate tool.

Is AVIF Royalty-Free?

AVIF is built on AV1, which the Alliance for Open Media developed as a royalty-free codec, and the container is an open ISO standard. That is the practical difference from HEIC, whose compression is patent-encumbered. JDeli handles the decoding and encoding in pure Java either way, so you do not assemble a native codec toolchain to read or write the format.

Reading AVIF

JDeli decodes AVIF 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 AVIF

JDeli encodes a BufferedImage to AVIF and writes to a byte[], File, or OutputStream. AV1 encoding is computationally heavy by nature, so encoding an AVIF is slower than encoding a JPEG regardless of library. Java's ImageIO cannot write AVIF at all, so this is functionality you cannot get from the JDK.

Converting AVIF

The JDeli.convert() methods turn an AVIF 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 Native AVIF Libraries?

ImageIO is not in the running here because it has no AVIF support. The real comparison is against native-backed libraries, and that is where pure Java earns its place.

No native code to deploy

ImageMagick and libavif bindings need a native binary 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 AVIF 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

Pulling a C/C++ codec into your stack through JNI means its vulnerabilities become yours, in memory the JVM does not manage. JDeli makes no calls to native code or external systems, so AVIF 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 AVIF support without changing the calls. You add the plugin JAR and the format your code could not open starts working.

Read and write in one library

JDeli reads and writes AVIF through the same API you use for every other format, so generating web assets and consuming uploads are the same two method calls rather than two separate toolchains.

Maintained on a schedule

JDeli ships a release every 6 weeks with a daily pre-release jar for customers, and format bugs are typically fixed within days of a reproducible report. Community-maintained native bindings move on their own timeline, if at all.

Already using ImageIO?

Java developers that work with ImageIO know of its lack of support for the AVIF format.
JDeli can effortlessly enhance 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 AVIF?

No. Java’s built-in ImageIO has no AVIF support. JDeli adds it via an ImageIO plugin. Drop in the JAR and your existing ImageIO.read() / ImageIO.write() calls gain AVIF support without code changes.

Are there free Java libraries for AVIF?

The main free option is vavi-image-avif, a Java ImageIO plugin that wraps native libavif via JNA, which requires native binaries on the server.

Can I convert a PDF to AVIF in Java?

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

How do I convert AVIF to JPG in Java?

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

How do I convert AVIF to PNG in Java?

Call JDeli.convert(new File("input.avif"), new File("output.png")). JDeli infers the output format from the file extension. See Convert AVIF to PNG in Java for a full example.

Why use JDeli for AVIF image support?

1.

Adds AVIF to ImageIO so works with existing code

2.

Reads and writes AVIF with no native code or third party libraries

3.

Pure Java, so no JNI and no JVM crashes

Try JDeli for Free