Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

How to read JPEG XL images in Java (Tutorial)

54 sec read

what is jpeg xl?

In this article, I will show you how to read JPEG XL images in Java. JPEG XL is a relatively new format so it is not currently supported by ImageIO or Apache Commons Imaging.  

How to read a JPEG XL image in Java with Jxlatte

Jxlatte is a ‘work-in-progess’ JPEG XL Decoder which can be used to convert to better supported Image formats using this code

java -jar jxlatte.jar samples/art.jxl output.png

How to read a JPEG XL image in Java with xpeg-xl wrapper

There are some Java wrappers for the  JPEG-XL library here. These allow you to read the image to a BufferedImage but do not offer a totally native solution.

BufferedImage img = ImageIO.read(Paths.get("/foo/bar.jxl").toFile())

How to read a JPEG XL image in Java with JDeli

JDeli supports reading JPEG XL image files out of the box. You can convert JPEG XL files into other formats directly in JDeli. You can also directly read any JPEG XL image into a Java BufferedImage with this code.

  1. Add JDeli to your class or module path (download the trial jar).
  2. Create a File handle, InputStream pointing to the raw JPEG XL image. You can also use a byte[] containing the image data.
  3. Read the JPEG XL image into a BufferedImage

    and the Java code to read JPEG XL…



Are you a Java Developer working with Image files?

Why do developers choose JDeli over free alternatives?

  1. Works with newer image formats such as AVIF, HEIC, JPEG XL, WEBP
  2. Better support than alternatives for JPEG, PNG, TIFF.
  3. Prevent JVM crashes caused by native code in other image libraries
  4. Better performance than other popular Java image libraries
Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.