I am currently writing an image converter in Java using ImageIO. Unfortunately ImageIO does not support many formats. The javadoc says it can be extended with plugins but I can't find any. I have tried JAI (Java Advanced Imaging) but it seems to be a whole new library not only a plugin.
Do you have an idea how to make ImageIO support more formats?
ImageIO uses a service provider API, and most plugins comes as a jar you simply put in classpath. ImageIO will pick them up automatically.
It's probably easier to give good answers, if you list the formats you need support for.
As mentioned, JAI adds some format support (note that you need the jai-imageio.jar, not the complete JAI package). Warning: Many of them requires native library support to be of much use, and the project seems to be left in limbo by Oracle.
I've written a couple of plugins (mostly readers), that will extend the number of formats supported (most notably TIFF, PSD (Photoshop) and PICT, as well as extended JPEG support).
jrawio is another good example (as mentioned in the comments), if you need camera RAW file support.
Googling brings up quite a few more. As I said, it all depends on what formats you need.
javax.imageio
support for formats works on the basis of a Service Provider Interface. An SPI is just a special Jar that:
AFAIU, JAI provides SPIs for other formats not supported by 'plain' ImageIO
.
For more details, see JavaTM Image I/O Technology.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With