Site iconJava PDF Blog

Why we have abandoned ImageIO and JAI for Image support in our commercial Java code

JDeli

jpeg-icon

At IDRsolutions, we are now using our own Java Image Library (JDeli) as a replacement for ImageIO and JAI. We had previously been using ImageIO and JAI to handle image data and write out BufferedImages as PNGs, JPEGs or Tiff and for decoding some image data inside PDF files since we started writing our Java PDF library in 1999.

However, this has become an increasingly frustrating and unsatisfactory solution for us 🙁

JAI has long been abandoned by Oracle (we have actually put out several tips and patches for JAI JPEG2000 bugs on our blog) which offers no alternative way to load JPEG2000 files in Java. The JPEG2000 implementation was never completed and is slow, memory-intensive, and does not handle lots of JPEG2000 files.

ImageIO has seen little improvement in recent Java releases, despite being the only way to load and save Images in Java. Indeed is it still needed in the new JavaFX code to load and save images. It also represents a big black box in our PDF to Image solution which we have no control over. So we have been busy writing our own Java image library (JDeli), and now use this instead of JAI or ImageIO.