If you’re working with a large number of AVIF files, converting them to JPG in bulk can streamline your workflow, especially when the JPG format is required for multiple applications.
You can read, write and convert AVIF files in Java with JDeli, our pure Java library.
AVIF (AV1 Image File Format) is a modern image format offering superior compression efficiency compared to JPEG and PNG. Converting images to AVIF results in significantly smaller file sizes with high visual quality. This leads to faster loading times and reduced bandwidth use on the web and other platforms.
In this article, I’ll show you how to convert AVIF images to JPG using Java and JDeli, making your files easier to work with. JDeli stands out as one of the most powerful Java libraries for handling and manipulating images.
Bulk convert AVIF to JPG using Java
- Download the JDeli trial jar.
- Process image if needed (scale, sharpen, lighten, watermark, etc)
- Write out BufferedImage as JPG image file
BufferedImage bufferedImage = JDeli.read(new File("avifImageFile.avif"));
// Read AVIF image into Java
bufferedImage = operations.apply(BufferedImage bufferedImage);
// Process image (Optional)
JDeli.write(bufferedImage, "jpg", new File("jpgImageFile.jpg"));
// Write out BufferedImage as JPEG image file
Export AVIF to JPG in one line of code
With the JDeli.convert() method you can save PNG as JPG in just one line of code.
Using File
JDeli.convert(File inFile, File outFile);Using InputStream and OutputStream
JDeli.convert(InputStream inputStream, OutputStream outputStream, "jpg");Using byte[]
byte[] outputData = JDeli.convert(byte[] inputData, "jpg");Configure Output Settings
You can use this option to specify an EncoderOptions object for configuring output settings such as image compression.
JDeli.convert(File inFile, EncoderOptions outputOptions, File outfile);
How to bulk convert AVIF to JPG from the command line
You can turn PNG to JPG using command line or bash, bat, and PowerShell scripts. This method also enables JDeli to be invoked from any programming language that supports creating a child process.
java -jar jdeli.jar –convert jpg "inputFileOrDir" "outputDir"
In this tutorial you learned how to bulk convert AVIF to JPG in bulk. JDeli has AVIF support for reading and writing as well, you read our documentation to find out more.
As experienced Java developers, we help you work with images in Java and bring over a decade of hands-on experience with many image file formats.
Are you a Java Developer working with Image files?
// Read an image
BufferedImage bufferedImage = JDeli.read(avifImageFile);
// Write an image
JDeli.write(bufferedImage, "avif", outputStreamOrFile);// Read an image
BufferedImage bufferedImage = JDeli.read(dicomImageFile);// Read an image
BufferedImage bufferedImage = JDeli.read(heicImageFile);
// Write an image
JDeli.write(bufferedImage, "heic", outputStreamOrFile);// Read an image
BufferedImage bufferedImage = JDeli.read(jpegImageFile);
// Write an image
JDeli.write(bufferedImage, "jpeg", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(jpeg2000ImageFile);
// Write an image
JDeli.write(bufferedImage, "jpx", outputStreamOrFile);
// Write an image
JDeli.write(bufferedImage, "pdf", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(pngImageFile);
// Write an image
JDeli.write(bufferedImage, "png", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(tiffImageFile);
// Write an image
JDeli.write(bufferedImage, "tiff", outputStreamOrFile);
// Read an image
BufferedImage bufferedImage = JDeli.read(webpImageFile);
// Write an image
JDeli.write(bufferedImage, "webp", outputStreamOrFile);
What is JDeli?
JDeli is a commercial Java Image library that is used to read, write, convert, manipulate and process many different image formats.
Why use JDeli?
To handle many well known formats such as JPEG, PNG, TIFF as well as newer formats like AVIF, HEIC and JPEG XL in java with no calls to any external system or third party library.
What licenses are available?
We have 3 licenses available:
Server for on premises and cloud servers, Distribution for use in a named end user applications, and Custom for more demanding requirements.
How does JDeli compare?
We work hard to make sure JDeli performance is better than or similar to other java image libraries. Check out our benchmarks to see just how well JDeli performs.
