<div dir="ltr">Hi Michael,<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There's no need for your workaround. If you have TwelveMonkeys bundled<br>with your application, JavaFX can read all of the supported images<br>"natively" without manually converting to BufferedImage first. You<br>just specify the WebP file in the constructor of Image.</blockquote><div><br></div><div>I know we could do this starting with JavaFX 24, but most of our users are using Java 21, and we need to maintain compatibility with JavaFX 14 in the long term, so we haven't made any special handling for JavaFX 24+ for the time being. </div><div><br></div><div>However, if JavaFX natively supports WebP, the benefits would make us willing to maintain an additional if-else statement.</div><div><br></div><div>Glavo</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Dec 4, 2025 at 4:21 AM Michael Strauß <<a href="mailto:michaelstrau2@gmail.com">michaelstrau2@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> For example, our application needs to display icons for Minecraft mods, modpacks, and other content sourced from Modrinth, and the vast majority of these icons are in WebP format. To work around this, we currently have to bundle TwelveMonkeys into our program, decode the images to BufferedImage, and then convert them to javafx.scene.image.Image. This approach significantly increases the size of our application, adds considerable performance overhead, does not support animated WebP, and even has a color-shift bug when decoding lossy-compressed WebP images.<br>
><br>
> Is there any possibility that JavaFX will add native support for modern image formats like WebP and AVIF in the future? I noticed that the javafx.web module already depends on libwebp during its build, yet this dependency is not utilized for javafx.scene.image.Image decoding—which is honestly a bit of a shame. We sincerely hope that JavaFX can provide native support for these formats.<br>
<br>
<br>
There's no need for your workaround. If you have TwelveMonkeys bundled<br>
with your application, JavaFX can read all of the supported images<br>
"natively" without manually converting to BufferedImage first. You<br>
just specify the WebP file in the constructor of Image.<br>
<br>
What's true is that this doesn't work for animated images.<br>
</blockquote></div>