7

I have few thousand images in HEIC format that need to be converted to jpg/png. Conversion needs to happen in a backend process preferably java.

What is the best way available to do this in java? If not, can anyone point me to a tutorial that explains how jpg can be obtained from HEIC format?

PKB
  • 101
  • 2
  • 5

2 Answers2

0

ImageMagick is great for converting images from the command line. There are two different Java interfaces, JMagick and im4java.

See the Image magick java question for tips how to get started.

user6708591
  • 339
  • 3
  • 10
-2

I've bumped into libheif library recently that is designed to fulfill your task - https://github.com/strukturag/libheif

There is also blog post that explains how to create wrapper bash script and use it to perform conversion using command line : https://stuffjasondoes.com/2019/07/10/batch-convert-heic-to-jpg-in-linux/

I presume you can call above script with ZT Process Executor ( https://github.com/zeroturnaround/zt-exec) or just use old plain Runtime.exec().

Or even get fancier and use JNI to compile with above library for better performance.