2018 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.
Latest posts by Bethan Palmer (see all)
- Java 10 Local-Variable Type Inference Explained in 5 Minutes - April 5, 2018
- Java 10 – An Introduction - April 3, 2018
- JDeli Roadmap for 2018 - February 12, 2018
- How to choose a name for a new product - February 8, 2018
- Replacing ImageIO with the JDeli image library - February 7, 2018