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.

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 22 and JavaFX 22 is required for v1.8.6 because of the foreign linker API usage, changes in JavaFX 21 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).

Open topics

Usage

Point to the maven coordinates:

JDK18

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

JDK22

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

You can have a look into the class TestAPP.java 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: