xinyu zhang Xinyu is a member of the web development, support, and marketing team at IDRsolutions.

How to Add HEIC Support to Java App

2 min read

how to write heic image (heic icon)

Java does not support HEIC by default. If you try this code to read or write HEIC image, it will fail.

This blog post explains how to fix this code using JDeli which supports HEIC files. This can be done by simply using our ImageIO Plugin with no changes to existing code or writing new code using JDeli directly.

What is HEIC?

HEIC stands for “High-Efficiency Image Container” and it is a specific implementation for still images inside HEIF. It was developed by MPEG and adopted by Apple but is an Open Standard. You can learn more about it in this blog.

Why is HEIC support important?

HEIC files are becoming increasingly common because:-

  1. They offer much smaller file sizes for a given quality than JPG file format
  2. They are the default option in the Apple Ecosystem (Macs, tablets, phones)

What libraries/ plugins to consider for HEIC support in Java?

There are a selection of Open Source and Commercial libraries which offer HEIC support to Java developers. We recommend JDeli because:-

  1. It can read and write HEIC files
  2. It offers the most complete implementation of the HEIC specification
  3. It is actively supported and developed
  4. It is pure Java, not a wrapper on a non-Java library.
  5. It is available as an ImageIO plugin so your existing image code will work with no changes

What is JDeli and why should you use it?

JDeli is a Java image library developed by IDRSolutions. It is designed for Java developers and is used by many global companies like Abacus, Mercedes-Benz Bank, Clearsense, USAA, etc.

JDeli is well-known for its advantage in premium support, easy integration, high security, outstanding performance, and simple pricing plan. You can read this blog to learn more about why JDeli is a great enterprise-level Java image library. It also supports other Image file formats including AVIF, JPEG, JPEG XL, TIFF, WEBP.

How to upgrade ImageIO to work with HEIC files

It’s actually very simple and can be done without rewriting your existing code!

For example, the code below does not work with ImageIO for HEIC images


 
Steps to fix:

Can I use JDeli directly?

You can write new code in JDeli which is designed to look like ImageIO API but adds new features


 

Conclusion

Adding HEIC support in Java can be done very simply with JDeli. All you need to do is replacing ImageIO with JDeli in your codes. Click here to try it out!



Are you a Java Developer working with Image files?

xinyu zhang Xinyu is a member of the web development, support, and marketing team at IDRsolutions.