Replacing ImageIO with the JDeli image library

JDeli logo2018 is an exciting year for JDeli, our Java image library. We first created JDeli to be a better alternative to ImageIO and solve some of the problems we were finding with ImageIO and JAI (you can find more detail here). And now we have added read and write methods so that you can easily swap ImageIO with JDeli in your code.

JDeli.read returns a BufferedImage as the result of decoding a supplied image file, or image file bytes. It can open files with extension of jpg, jpeg, jp2, jpx, dcm, png, webp, sgi, rgb, tiff, psd and bmp.

JDeli.write compresses the supplied BufferedImage into the given output format. It can write out files as PNG, JPEG, TIFF or BMP.

For example, if I wanted to read a PNG and then write it out as a TIFF, I could do the following:

File imageFile = new File("C:\\Users\\Bethan\\Desktop\\example-png.png");
File outputFile = new File("C:\\Users\\Bethan\\Desktop\\example-tiff.tiff");
BufferedImage image = JDeli.read(imageFile);
JDeli.write(image, JDeli.OutputFormat.TIFF, outputFile);

So it is as easy to use in your code as ImageIO, and has the benefits of being a more reliable library.

Why JDeli over ImageIO?

JDeli is a much better image library for reading and writing images. Unlike ImageIO, it is a pure Java solution and it is actively supported and developed. It offers much better support for Tiff, JPEG and JPEG2000 than ImageIO and supports additional image formats such as DICOM, PSD, SGI and WEBP.

In my next post I will talk about our roadmap for 2018, and the exciting plans we have to improve JDeli even further in the future.

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (Twitter, Facebook and Google+) or the Blog RSS.

Related Posts:

The following two tabs change content below.

Bethan Palmer

Developer at IDR Solutions
Bethan is a Java developer and product manager for JPedal at IDRsolutions. She has spoken at conferences including JavaOne and NetBeans day and has a degree in English Literature.
Bethan

About Bethan Palmer

Bethan is a Java developer and product manager for JPedal at IDRsolutions. She has spoken at conferences including JavaOne and NetBeans day and has a degree in English Literature.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>