AVIF Converter
JDeli is a pure Java image library that converts AVIF files to and from a wide range of other image formats with no native dependencies. It accepts File, InputStream, and byte[] input, and supports batch conversion from the command line.
Why use JDeli instead of Java ImageIO
Java’s built-in ImageIO has limited or no support for many modern image formats and can produce incorrect colours, handle metadata poorly, or fail silently on certain files. JDeli is a pure Java library that provides reliable AVIF support across all supported input and output types.
To run the code examples you will need to download the JDeli jar:
Convert AVIF in one line of Java code
The JDeli.convert() methods let you convert AVIF images in just ONE line of code.
Using File
JDeli.convert(File inFile, File outFile);
JDeli.convert(File inFile, EncoderOptions encoderOptions, File outFile);
JDeli.convert(File inFile, File outFile, ImageProcessingOps imageProcessingOps); Link
Using InputStream and OutputStream
JDeli.convert(InputStream inputStream, OutputStream outputStream, "avif");
JDeli.convert(InputStream inputStream, EncoderOptions encoderOptions, OutputStream outputStream);
JDeli.convert(InpaavVIF should ike utStream inputStream, OutputStream outputStream, ImageProcessingOps imageProcessingOps);
Using byte[]
byte[] outputData = JDeli.convert(byte[] inputData, "avif");
byte[] outputData = JDeli.convert(byte[] inputData, EncoderOptions encoderOptions);
byte[] outputData = JDeli.convert(byte[] inputData, "avif", ImageProcessingOps imageProcessingOps);
Batch convert AVIF images from the command line
Convert images in bulk from the command line, or from bash, bat, and PowerShell scripts. This also lets you invoke JDeli from any language that supports spawning child processes.
java -jar jdeli.jar --convert avif "inputFileOrDir" "outputDir"
How to convert AVIF images as separate steps in Java
Sometimes you need more control over the conversion process. JDeli lets you read an image into a BufferedImage, optionally process it, then write it out in any supported format.
- Read the AVIF file into Java
BufferedImage bufferedImage = JDeli.read(new File("image.avif")); - Process image if needed (scale, sharpen, watermark, etc.)
bufferedImage = operations.apply(bufferedImage); // Optional - Write the BufferedImage out as any supported format
JDeli.write(bufferedImage, "outputFormat", new File("output.outputFormat"));
Frequently asked questions
Can JDeli convert AVIF without installing native libraries?
Yes. JDeli is a pure Java library. No DLLs or native libraries are required — it runs on any platform where the JVM runs.
What input types does JDeli accept for AVIF conversion?
JDeli accepts File, InputStream, and byte[] as input. Output can be written to a File, OutputStream, or returned as byte[].
Can I process the image during conversion?
Yes. All JDeli.convert() variants accept an optional ImageProcessingOps parameter, letting you scale, sharpen, watermark, and apply other operations in the same step.
Can I batch convert AVIF files?
Yes. Pass a directory path as the input argument on the command line and JDeli will convert all images in that directory.