Link
Skip to main content

Java AVIF Writer

Java’s built-in ImageIO does not support writing AVIF files. JDeli is a 100% Java AVIF writer that provides full encoding control with no dependencies.

Getting started

Add JDeli to your project via Maven or Gradle, or see using JDeli with Java modules.

What is supported

The JDeli AVIF writer supports the following features:

Feature Support
Compression - Lossy Yes
Compression - Lossless No
Quality control Yes
Encoder speed setting No
YUV 4:2:0 Yes
YUV 4:2:2 No
YUV 4:4:4 No
HDR No
Alpha Soon
Animation No
Tiling Yes
Metadata EXIF
ICC No
Output to file Yes
Output to OutputStream Yes
Output to byte[] Yes
Pure Java implementation Yes

Quick start or to replace in existing code using ImageIO:

The simplest way to write a AVIF image is:

JDeli.write(bufferedImage, "avif", file);

Or to a byte array:

byte[] avifData = JDeli.write(bufferedImage, "avif");

Or to an OutputStream:

JDeli.write(bufferedImage, "avif", os);

Simple usage

For better type safety, use OutputFormat:

JDeli.write(myBufferedImage, OutputFormat.AVIF, outputStreamOrFile);

OutputFormat allows setting of any supported Image Format

Benefits:

  • Compile-time safety
  • Cleaner code
  • Recommended for new applications

Advanced usage: controlling the output

Use avifEncoderOptions when you need control over encoding behaviour.

final AvifEncoderOptions options = new AvifEncoderOptions();


//write out
JDeli.write(myBufferedImage, options, outputStreamOrFile);

AvifEncoderOptions allows setting of specific options.

Various image processing operations can be conducted on the image, detailed documentation can be found here.


Frequently asked questions

Can Java write or encode AVIF files without external libraries?

No. Java’s built-in ImageIO does not support writing or encoding AVIF files. JDeli provides a pure-Java AVIF encoder with no dependencies required.

Does writing or encoding AVIF in Java with JDeli require additional libraries?

No. JDeli is a 100% Java library with no dependencies. It runs on any platform where the JVM runs with no additional installation.

What output types does JDeli support for writing AVIF?

JDeli can write and encode AVIF to a File, OutputStream, or return the encoded data as a byte array.

See also


Why JDeli?

  • Support image formats such as AVIF, HEIC and JPEG XL that are not supported in Java.
  • Process images up to 3x faster than ImageIO and alternative Java image libraries.
  • Prevent JVM crashes caused by native code in other image libraries such as ImageIO.
  • Handle JPEG, PNG, TIFF image file formats fully in Java.
  • Keep your Image files secure as JDeli makes no calls to any external system or third party library.

Learn more about JDeli

Start Your Free Trial