We created JDeli to be a better alternative to ImageIO. If you add JDeli to your classpath, ImageIO will automatically use for all supported Image formats. So no code changes are needed for existing code.
We have added read and write methods so that you can easily write new JDeli commands 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, heic, 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 BMP, PNG, JPEG, HEIC, TIFF or WEBP.
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);
If you would like to watch a tutorial on how to read and write TIFF images with JDeli, check out this video.
So it is as easy to use in your code as ImageIO, and has the benefits of being a more reliable library.
Are you a Java Developer working with Image files?
// 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);
Why do developers choose JDeli over free alternatives?
- Works with newer image formats such as AVIF, HEIC, JPEG XL, WEBP
- Better support than alternatives for JPEG, PNG, TIFF.
- Prevent JVM crashes caused by native code in other image libraries
- Better performance than other popular Java image libraries