TL;DR:
Java’s ImageIO has no HEIC support. To write HEIC files in Java you need an external library. JDeli is the only pure Java implementation — it works as a drop-in ImageIO plugin with no code changes required, and also provides a direct API. A free alternative using native binaries is available via Nokia’s HEIF library on GitHub.
Does Java support HEIC natively?
No. ImageIO has no HEIC codec. Both reads and writes fail silently or return null without an external library:
// Both of these fail with vanilla ImageIO
// Read
BufferedImage image = ImageIO.read(new File("input.heic")); // returns null
// Write
ImageIO.write(bufferedImage, "heic", new File("output.heic")); // returns false
HEIC is the default image format for Apple devices and is increasingly common in production environments. You need an external library to handle it in Java.
Which Java HEIC library should you use?
| JDeli | Nokia HEIF (Java wrappers) | |
|---|---|---|
| Pure Java (no native binaries) | ✓ | ✗ (wraps native libs) |
| Works as ImageIO plugin | ✓ | ✗ |
| Direct API | ✓ | ✓ |
| Read and write HEIC | ✓ | ✓ |
| Encoder options (quality, compression) | ✓ | Limited |
| Supports other formats (AVIF, WebP, TIFF…) | ✓ | ✗ |
| Cost | Commercial | Free |
| Support | Included | GitHub issues |
| Actively developed | ✓ | Limited |
The Nokia library is a reasonable free option if native binaries are acceptable in your environment. JDeli is the better choice for server deployments, containerised environments, or anywhere distributing platform-specific binaries is impractical or a security concern.
Option 1: Add HEIC support to ImageIO (no code changes)
JDeli registers itself as an ImageIO plugin. Once it is on the classpath, your existing ImageIO.read() and ImageIO.write() calls handle HEIC automatically with no code changes required.
Maven
<dependency>
<groupId>com.idrsolutions</groupId>
<artifactId>jdeli</artifactId>
<version>[JDELI_VERSION]</version>
</dependency>
Gradle
implementation 'com.idrsolutions:jdeli:[JDELI_VERSION]'
Alternatively, download the trial jar and add it to your classpath manually. See the ImageIO configuration guide for setup details.
Once JDeli is on the classpath, your existing ImageIO code works unchanged:
// Read — works once JDeli is on the classpath
BufferedImage bufferedImage = ImageIO.read(new File("input.heic"));
// Write — same
ImageIO.write(bufferedImage, "heic", new File("output.heic"));
Option 2: Write HEIC directly with the JDeli API
The JDeli API gives you more control and does not depend on ImageIO’s plugin registration order.
- Add JDeli to your class or module path. (download the trial jar)
- Create a
FileorOutputStreamfor the output. - Call
JDeli.write()with your image, format, and output target.
// String format
JDeli.write(bufferedImage, "heic", new File("/path/to/output.heic"));
// Type-safe enum (preferred)
JDeli.write(bufferedImage, OutputFormat.HEIC, new File("/path/to/output.heic"));
Controlling output with HeicEncoderOptions
For production use, pass a HeicEncoderOptions object to control quality and other output settings:
HeicEncoderOptions options = new HeicEncoderOptions();
JDeli.write(bufferedImage, options, new File("/path/to/output.heic"));
See the JDeli HEIC documentation for the full list of encoder options.
Frequently asked questions
What is the HEIC format?
HEIC (High Efficiency Image Container) is Apple’s default image format, used on iPhone and iPad since iOS 11. It is based on the HEVC codec and typically produces files around half the size of equivalent JPEG images at the same visual quality. It supports transparency, HDR, and sequences of images (used for Live Photos).
Why does Java not support HEIC?
Java’s ImageIO is extensible but ships with a limited set of built-in codecs. HEIC is a relatively recent format with patent and licensing considerations, so it was not added to the standard library. An ImageIO plugin such as JDeli adds the missing support.
Can I read HEIC files in Java with JDeli?
Yes. See our companion article: how to read HEIC files in Java.
Is JDeli pure Java?
Yes. JDeli has no native binaries and makes no calls to platform-specific libraries. This makes it straightforward to deploy on any Java-supported platform, including containerised and server environments.
Can I convert HEIC to JPG in Java?
Yes. See our tutorial: how to convert HEIC to JPG in bulk.
Other useful HEIC resources
- How to read HEIC files in Java
- How to convert HEIC to JPG in bulk
- JDeli HEIC support
- JDeli HEIC documentation
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.
