LibRawFX

Integration of LibRaw (https://www.libraw.org) library for JavaFX for all major operating systems (Linux, Windows, OSX). All raw formats can be loaded with the Image class and manipulated by Pixelwriter/Pixelreader. Limitation is that the image class only supports 8-bit color deph but converts all 16bit image format to 8bit automatically.

New is now that the plugin supports now a moore general plugin type which is ImageIO. Therefore also Swing developers can use the lib to load images. Beginning of 1.9.3 the ImageIO function is included. On Javafx side you can choose which method you will use, all others use automatically ImageIO. The support for ImageIO is now beta.

Donate

JDK 18 is required for v1.8.0 because of the foreign linker API usage and the big changes for threading happenend in Panama in JDK18

JDK 24 and JavaFX 24 is required for v1.9.3 because of the foreign linker API usage, changes in JavaFX 24 and the big changes for threading happenend in Panama in JDK22. Major rewrite without separate Win/Linux code anymore.

Status

Now the lib is in production ready status. That means it is tested on all operating systems (OSX, Linux, Win10) and under different threading scenarious.

Supported OS:

I have integrated LibRaw SNAPSHOT version 0.21.2 (https://www.libraw.org/news/libraw-0-21-2-release)

Actually only the following raw formats are enabled (see class RAWDescriptor.java):

The lib now resized the image in memory before sending it back to the image class (the same as the Javafx is doing for PNG/JPG). You can now specify for each camera model different settings for the raw decoder (sample below). ImageIO plugin is provided and should be automatically installed.

Open topics

Usage

Point to the maven coordinates:

JDK18

<dependency>  
    <groupId>org.librawfx</groupId>    
    <artifactId>LibRawFX</artifactId>  
    <version>1.8.0</version>  
</dependency>  

JDK24

<dependency>  
    <groupId>org.librawfx</groupId>    
    <artifactId>LibRawFX</artifactId>  
    <version>1.9.3</version>  
</dependency>  

You can have a look into the class TestAPP.java, TestAppSwing.java, TestAppImageIO to see how to use it, but generally just create an Image with the URL/stream and add it to the image view:

  Image img=new Image(initialFile.toURI().toURL().toString(), false);  
  ImageView view = new ImageView();  
  view.setFitHeight(200);  
  view.setFitWidth(200);  
  view.setPreserveRatio(true);  
  stack.getChildren().add(view);  
  view.setImage(img);

You can also use the lib without adding the file handler. What I mean is that you can also forget the “…install” line and just load a file URL with the lib (see the TestApp.java to see how it works).

Steps to create your own build:

Notes:

JFXCentral