NightMonkeys
A collection of ImageIO plugins, adding support for newer image formats. NightMonkeys uses the newer Foreign Linker API available in JDK 18 to access native libraries.
How it works
NightMonkeys plugins are released as multi-release JARs:
- with Java < 18, a no-op version of the plugin will unregister itself on load, basically doing nothing
- with Java 18+, the plugin will be available
This lets you add the dependencies in your project whatever the JDK used, and still enable the plugin at runtime if the necessary JDK is used.
Supported formats
Plugin | Format | Read | Write | Metadata | Notes |
---|---|---|---|---|---|
jxl | Jpeg XL |
|
- | - | |
webp | WebP |
|
- | - |
Requirements
In order for the plugins to run properly, you will need to:
- Run Java with the following options:
--add-modules jdk.incubator.foreign --enable-native-access=ALL-UNNAMED
- Make sure the path to the directory containing the native libraries is contained in the Java system property
java.library.path
(check also this).- For Linux, normally it works fine when installed from a package manager. You can add the libraries' path to the
LD_LIBRARY_PATH
environment variable. - For Mac, if using HomeBrew, you will need to set
JAVA_LIBRARY_PATH
to/usr/local/lib/
.
- For Linux, normally it works fine when installed from a package manager. You can add the libraries' path to the
Installation
Gradle | runtimeOnly "com.github.gotson.nightmonkeys:imageio-{plugin}:{version}" |
Gradle (Kotlin DSL) | runtimeOnly("com.github.gotson.nightmonkeys:imageio-{plugin}:{version}") |
Maven | <dependency> <groupId>com.github.gotson.nightmonkeys</groupId> <artifactId>imageio-{plugin}</artifactId> <version>{version}</version> <scope>runtime</scope> </dependency> |